I have an nginx
and a pgadmin
Docker container connected to each other. Only nginx
container is exposed to the outside. How can I map pgadmin
to a sub URI?
If the host is example.com
, I want the pgadmin
to be reachable at example.com/pgadmin/
. So far, I have this in my nginx.conf
file:
location ^~ /pgadmin/ {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://pgadmin:80/;
}
A request to example.com/pgadmin/
goes through to pgadmin
but when pgadmin redirects to the login page, it redirects to example.com/login?next=%2F
, not to example.com/pgadmin/login?next=%2F
.
How can I make pgadmin
to work at example.com/pgadmin
?