I'm trying to figure out how to configure a reverse proxy in nginx when the endpoint is in a root context:
http://frontend.com/mylink
proxy forwards to http://10.0.0.2:8000/
Unfortunately I can't change the context of the application at http://10.0.0.2:8000
, so I'm trying to figure out a workaround in nginx for this issue. The following configuration usually works fine when there is a context, but doesn't work in the situation above:
location /mylink {
proxy_pass http://10.0.0.2:8000;
proxy_redirect http://10.0.0.2:8000 /mylink;
port_in_redirect off;
}
Any ideas what I'm missing here?