You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/deployment/general/deployment-location.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,55 @@ For apps deployed to Mendix Cloud, you can customize a URL by adding [custom dom
19
19
20
20
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](/refguide/custom-settings/#applicationrooturl-section)`ApplicationRootUrl`.
21
21
22
+
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 Nginx configuration.
23
+
24
+
```
25
+
# Location block for the subpath "/my/sub/path".
26
+
27
+
location /my/sub/path/ {
28
+
29
+
# Make the Mendix runtime aware of https, see documentation below for more information.
30
+
proxy_set_header X-Forwarded-Proto "https";
31
+
32
+
# Forward the host to the Mendix runtime.
33
+
proxy_set_header X-Forwarded-Host $host;
34
+
35
+
# Forward the prefix `/my/sub/path` to the Mendix runtime.
36
+
proxy_set_header X-Forwarded-Prefix /my/sub/path;
37
+
38
+
# Optional: forward a port when not running on standard ports.
39
+
# proxy_set_header X-Forwarded-Port 3000;
40
+
41
+
# Required for Mendix DevTools to work.
42
+
proxy_http_version 1.1;
43
+
44
+
# Proxy the request to the Mendix runtime.
45
+
proxy_pass http://mendix-runtime:8080/;
46
+
}
47
+
```
48
+
22
49
{{% alert color="info" %}}
23
50
Routing based on a subpath is possible as of Studio Pro 10.3 (for details, see the [ApplicationRootUrl](/refguide/custom-settings/#applicationrooturl-section) section of the *Runtime Customization* page), although it is not supported in Mendix Cloud. For versions below 10.3, it is not possible to use a path to your app. Your app should always be at the root of your subdomain. In other words, it should be at a location like this: `https://subdomain.domain/`.
24
51
25
52
If you want to deploy several apps on the same domain, use different subdomains to identify the app. For example, use `https://appA.apps.mydomain.com/`, not `https://mydomain.com/apps/appA`.
26
53
{{% /alert %}}
27
54
55
+
## Secure Cookies for On-Premise Applications
56
+
57
+
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.
58
+
59
+
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:
60
+
61
+
* Configure the [ApplicationRootUrl](/refguide/custom-settings/#applicationrooturl-section) runtime setting with an `https://` URL
62
+
* Set the `X-Forwarded-Proto` or `X-Forwarded-Schema` header to `https` in the loadbalancer.
63
+
64
+
{{% alert color="info" %}}
65
+
66
+
* For Mendix versions prior to Mendix 10.18, setting the [ApplicationRootUrl](/refguide/custom-settings/#applicationrooturl-section) 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.
67
+
68
+
* For Mendix versions 10.18 and later, setting the [ApplicationRootUrl](/refguide/custom-settings/#applicationrooturl-section) runtime setting to an `http://` URL will take precedence over the `X-Forwarded-Proto` and `X-Forwarded-Schema` headers.
69
+
{{% /alert %}}
70
+
28
71
## Main Domain Name
29
72
30
73
Do not deploy your app directly at the apex domain (`https://domain/`).
0 commit comments