Hi Alessandro,
you have basicaly two options how you can enable your app users to access Mendix on Edge applications.
First option (recomended) is to use the embeded reverse proxy of Industrial Edge. Edge then takes care of the login and also securing the communicaiton to be HTTPS and not just HTTP. This option also allows you to use the remote access feature from IEM.
With this option you can choose the string in the URL after the device IP address/DNS name. For example
https://192.168.100.1/mymendixapp/
you cannot choose the root domain because that is reserved for the edge runtime.
all you need to do is choose the default nginx configuration in the plugin wizzard and then select this option in URL dropdown menu.
For example this is how I expose my app as https://192.168.100.1/mendix/ on any IED.
In the Version Creation then you will have the option to select that option:
If you have this configured then you also can configure a DNS to IP resolution in your own DNS server and then you can have something like
https://myied.com/mymendixapp/
to replace the IP address with DNS name. Please note that you need to have a proper DNS infrastructure in place to be able to use this DNS name.
Second option is to use a simple port maping in the docker compose file which as you correctly already tried in your example
- "60000:8080"
Then you app will be accesible via IP address of the edge device and your selected port on HTTP
http://192.168.100.1:60000
This is not the recommended option but good starting point for debugging.
Hey Alessandro,
You can use MXRUNTIME_ApplicationRootUrl: "https://myapp" under environment variables.
If you opt to use NGINX explicitly, then it is not required to set. Instead, NGINX will handle all the requests
Hi,
I have a similar question, but I want to access Mendix via the standard https://edge_ip/medix.
My app consists of a backend, a database, and the Mendix container. I want to build it through our CI/CD pipeline, not manually with the plugin.
Could you help me with the NGINX settings for Mendix?
Do I need to expose a port, or will NGINX handle that? I don’t want to access the app via HTTP on a port number.
(I know it’s running in dev mode; that will be changed later.)
My simplified docker-compose and nginx config. I use the IECTL to upload the app to the IEM.
mendix-client:
image: custom_mendix:latest
container_name: mendix-client
mem_limit: 1024m
environment:
- RUNTIME_PORT=8080
- MXRUNTIME_DTAPMode=D
- ADMIN_PASSWORD=...
- CF_INSTANCE_INDEX=0
- MXRUNTIME_UseXForwardedHeaders=true
# Database configuration
- MXRUNTIME_DatabaseType=PostgreSQL
- MXRUNTIME_DatabaseHost=postgres-db:5432
- MXRUNTIME_DatabaseName=...
- MXRUNTIME_DatabaseUserName=...
- MXRUNTIME_DatabasePassword=...
depends_on:
- postgres
restart: unless-stopped
networks:
- app-network
- proxy-redirect
Add these are my edge app settings:
NGINX_JSON: '{"mendix-client":[{"name":"appname","protocol":"HTTP","port":"8080","headers":"{}","subPath": "", "rewriteTarget":"/", "isSecureRedirection":false, "bypassUrlDecoding":false}]}'
REDIRECT_SECTION: "mendix-client"
REDIRECT_TYPE: "FromBoxReverseProxy"
REDIRECT_URL: "medix/"
IMAGE_TAR_JSON: '{"backend":"backend.tar", "mendix-client":"mendix.tar", "postgres":"postgres.tar"}'