---
title: "Serve Servicely behind a reverse proxy"
site: admin
version: 2027.1
versions: "all"
url: https://docs-new.servicely.ai/admin/2027.1/access/sign-in/reverse-proxy/
type: task
application: platform
last_updated: 2026-12-03
commit: 8d233372fa05
---


A reverse proxy on your own web servers serves your instance from your own address, such as `https://support.example.com`, and the browser keeps showing that address. Follow this task once the proxy works, so that Servicely builds its links and its single sign-on addresses from your address.

## Before you begin

- You need the `administrator` role.
- Switch to the Administration workspace with the **Workspace** selector at the foot of the menu.
- The reverse proxy is set up and tested. Your organisation runs and supports it. A domain or a subdomain both work, as long as you enter the same full address everywhere.
- Tell Servicely Support that you are making the change.
- On a live instance, plan the change for a time outside business hours.
- Copy the current script and, if you use single sign-on, the identity provider's **Login URL** and **IDP Metadata XML** to a file, so you can put them back.

## Steps

<Steps>
  <Step>
    Go to **Applications & licensing → Applications → Application properties**.

    <Image src="asset:screenshots/admin/access-sign-in-reverse-proxy/application-properties-menu.png">The Applications & licensing menu open at Applications, with Application properties.</Image>
  </Step>
  <Step>
    Open `system.baseurl`, replace the address in **Application properties value** with your own, and select **Save**.
  </Step>
  <Step>
    Go to **Scripting & automation → Scripts → System configuration scripts**.

    <Image src="asset:screenshots/admin/access-sign-in-reverse-proxy/system-configuration-scripts-menu.png">The System configuration scripts item under Scripts in the Scripting & automation menu.</Image>
  </Step>
  <Step>
    Open "Set initial BaseURL System Property". The default script runs each time a server node starts and sets `system.baseurl` back to the instance's own Servicely address.

    <Image src="asset:screenshots/admin/access-sign-in-reverse-proxy/system-configuration-scripts.png" size="68">The System configuration scripts list with Set initial BaseURL System Property, of type Node startup.</Image>
  </Step>
  <Step>
    Replace the script with this one and select **Save**. Set `instanceAddress` to your instance's Servicely address and `proxyAddress` to your own. Enter both without a slash at the end.

    <!-- source: platform/data/SystemConfigurationScript?Name=Set initial BaseURL System Property -->
    ```javascript
    // See if the property already exists
    let propertyRecord = ApplicationPropertyManager.getGlobalPropertyRecordByKey("system.baseurl");
    let generatedBaseURL = ApplicationPropertyManager.generateDefaultBaseUrl();

    let instanceAddress = "https://<instance>.servicely.ai"; // The instance's Servicely address
    let proxyAddress = "https://support.example.com"; // Your reverse proxy address

    if (propertyRecord == null) {
        // It doesn't exist, so create the property
        ApplicationPropertyManager.createGlobalPropertyRecord(
            "system.baseurl",
            generatedBaseURL,
            "string",
            "The base URL to use for URL construction (e.g. creating external links)"
        );
    } else {
        let currentValue = propertyRecord.Value();

        if (generatedBaseURL == instanceAddress) {
            // On the production instance, keep the reverse proxy address
            if (currentValue != proxyAddress) {
                propertyRecord
                    .Value(proxyAddress)
                    .update();
            }
        } else {
            // On any other instance, such as a clone, use its own address
            if (currentValue != generatedBaseURL) {
                propertyRecord
                    .Value(generatedBaseURL)
                    .update();
            }
        }
    }
    ```
  </Step>
</Steps>

## Result

Servicely builds external links from your address. The address stays after a restart of the production instance. An instance cloned from production sets the base URL to its own Servicely address when it starts.

## Variations

### Single sign-on is already set up

The identity provider holds addresses built from the old base URL. Replace them after you change `system.baseurl`.

1. Go to **Access & security → Authentication → Identity provider** and open the identity provider.
2. Clear **Login URL**, **IDP Metadata XML** and **SP Metadata XML**, and select **Save**. Servicely writes **SP Metadata XML** again from the new base URL.
3. In your identity provider's own administration, replace the Servicely address with yours in the identifier and the reply URL. Keep the rest of each URL, from `/idp_callback` on.
4. Download the identity provider's metadata again, paste it into **IDP Metadata XML** and select **Save**. Servicely fills in **Login URL** from it.
5. Sign in through single sign-on in a private browser window.

If you set up single sign-on after the proxy, the URLs already use your address.

## Related

- [Set up single sign-on with Microsoft Entra ID](page:access/sign-in/sso-microsoft-entra-id)
- [Application properties](page:platform/applications-and-licences/application-properties)
- [System configuration scripts](page:automation/scripts/system-configuration-scripts)
- [Restrict access by IP address](page:access/sign-in/restrict-access-by-ip-address)
