I'm trying to use nginx as reverse proxy in front of a few applications which are on the same machine(Docker containers). As a test, I tried to connect PHPmyAdmin to a URI like: www.example.com/phpma
This is how my location block looks like:
location /phpma/ {
proxy_pass http://192.168.2.23:8081/;
proxy_redirect off;
proxy_set_header Host $host;
}
Everything works fine until you try to login or out.
Lets say when you put your username & pass and click login button, application redirects you to the home page. The URL is like :
https://example.com/index.php?route=/&route=%2F
Now, user faces an error, because the actual url from user side should have the /phpma uri added to the redirect link. Lets say the above url should be like:
https://example.com/phpma/index.php?route=/&route=%2F
How can we overcome a situation like this, or in a production environment how we should design our application to address this? Thanks