Hi Uwe
Great question, Uwe. This is a classic dual-deployment challenge when integrating Mendix with Teamcenter AWC via iFrame.The ApplicationRootUrl constant is a static server-side setting that Mendix uses to construct absolute URLs (deep links, callbacks, etc.). When hardcoded to the Teamcenter-facing URL, the standalone access breaks because the root URL no longer resolves correctly for direct browser access and vice versa. The best method to resolve this is by using reverse proxy/nginx in front of your Mendix server that routes traffic based on the request origin or path.
# NGINX example
server {
listen 80;
# Teamcenter AWC iFrame traffic
location /mxapppath/ {
proxy_pass http://mendix-server:8080/;
proxy_set_header X-Forwarded-Host siemensdc:3000;
}
# Standalone traffic
location / {
proxy_pass http://mendix-server:8080/;
}
}
Set ApplicationRootUrl to the publicly accessible standalone URL.The reverse proxy handles the path rewriting for the iFrame context.Both entry points hit the same Mendix runtime
I hope this helps
Hi,
This behavior is expected because ApplicationRootUrl is being treated as a static configuration, which forces the app to always assume it is running inside the iFrame context.
To support both iFrame (Teamcenter AWC) and standalone modes, you should avoid hardcoding this value and instead make the behavior dynamic based on the request context.
1. Do not hardcode ApplicationRootUrl globally
Keep it empty or set it to the default base URL of your Mendix app.
2. Detect iFrame vs standalone at runtime
You can determine whether the app is running inside an iFrame using client-side logic:
if (window.self !== window.top) {
// Running inside iFrame
} else {
// Standalone mode
}
3. Pass context to Mendix (via URL or parameter)
From Teamcenter, launch the Mendix app with a parameter, for example:
https://your-mendix-app/?mode=iframe
4. Handle behavior in Mendix (microflow/nanoflow)
mode parameter5. Adjust URL handling dynamically
Instead of relying on ApplicationRootUrl, compute URLs dynamically:
ApplicationRootUrl)If the marketplace module strictly depends on it:
ApplicationRootUrl should not be fixed if you need dual-mode support. The correct approach is to detect the runtime context (iFrame vs standalone) and adjust behavior dynamically, typically via URL parameters or client-side checks. This allows the same Mendix app to function correctly in both scenarios without breaking standalone access.