How to Resolve Nginx Reverse Proxy Issue with Mendix App Routing?

0
Greetings all, I'm facing a problem with my Nginx reverse proxy configuration. I have the following setup: myapp.com as the main app (mendix vr 9.24.5) k8s-myapp1.com hosting another app called app1 (mendix 10.4.1) k8s-myapp2.com hosting another app called app2 (mendix 10.6.8) I've configured Nginx to route requests as follows: / to myapp.com /app1 to k8s-myapp1.com /app2 to k8s-myapp2.com However, I'm encountering an issue where accessing resources like the login page always points to /login.html of the root instead of /login.html of app1 or app2. Also, I face this problem in some icons like the date-picker.svg as an example, or the chevrons in the dropdown inputs. Even the browser shows that I am in myapp.com/app1, the request sent to myapp.com/icons/date-picker.svg and not myapp.com/app1/icons/date-picker.svg.   I've already tried rewriting the Urls using rewrite and sub_filter but everytime I encounter the same problem.   I am writing down the simplest config so everyone can help and use it as a starting point.   server {       listen 80;       server_name myapp.com;     location / {         proxy_pass http://myapp.com;       }     location /app1 {         proxy_pass http://k8s-myapp1.com;     }     location /app2 {         proxy_pass http://k8s-myapp2.com;    } }
asked
0 answers