Deployment Location

Last modified: January 15, 2026

Introduction

When you deploy your app outside Mendix Cloud, you can choose the URL that points to your app. However, there are some restrictions on where you should deploy your app.

For apps deployed to Mendix Cloud, you can customize a URL by adding custom domains.

Paths

If you specify an app URL location on a (sub)path, the Mendix runtime needs to know the public URL of your application. This can be done by setting the custom runtime setting ApplicationRootUrl.

When hosting a Mendix application on a subpath, the proxy needs to forward the request from https://subdomain.domain/my/sub/path to the internal address where the Mendix runtime is running. Refer to the code snippet below for an example Nginx configuration.

# Location block for the subpath "/my/sub/path".

location /my/sub/path/ {

    # Make the Mendix runtime aware of https, see documentation below for more information.
    proxy_set_header X-Forwarded-Proto "https";

    # Forward the host to the Mendix runtime.
    proxy_set_header X-Forwarded-Host $host;

    # Forward the prefix `/my/sub/path` to the Mendix runtime.
    proxy_set_header X-Forwarded-Prefix /my/sub/path;

    # Optional: forward a port when not running on standard ports.
    # proxy_set_header X-Forwarded-Port 3000;

    # Required for Mendix DevTools to work.
    proxy_http_version 1.1;

    # Proxy the request to the Mendix runtime.
    proxy_pass http://mendix-runtime:8080/;
}

Secure Cookies for On-Premise Applications

The Mendix runtime automatically sets cookies with the secure attribute when applications are served over HTTPS. However, when deploying a Mendix application behind a load balancer that uses HTTP for internal communication, additional configuration is required.

In this case, the Mendix runtime must be explicitly informed that end-users are accessing the application via HTTPS. This can be done through either of these methods:

  • Configure the ApplicationRootUrl runtime setting with an https:// URL
  • Set the X-Forwarded-Proto or X-Forwarded-Schema header to https in the loadbalancer.

The behavior of these two methods vary depending on your Mendix version:

  • Mendix versions 10.17 and below: Setting the ApplicationRootUrl runtime setting to an https:// URL will not make the application aware of it being served via HTTPS. You must use the X-Forwarded-Proto and X-Forwarded-Schema headers instead.

  • For Mendix versions 10.18 and above: Setting the ApplicationRootUrl runtime setting to an http:// URL will take precedence over the X-Forwarded-Proto and X-Forwarded-Schema headers.

  • For Mendix versions 10.24 and above: The X-Forwarded-Proto and X-Forwarded-Schema headers will take precedence over the ApplicationRootUrl. Mendix recommends using the ApplicationRootUrl setting as the default approach and only set X-Forwarded-Proto and X-Forwarded-Schema headers if needed.

Main Domain Name

Do not deploy your app directly at the apex domain (https://domain/).

This conflicts with the https://www.domain/ URL because the main domain is often redirected there if there is no subdomain specified.

Also, you would not be able to have additional custom domains for your app because you cannot create a CNAME record that points to an apex domain.