I want to deploy some web applications on different ports on the same host, with nginx reverse proxy.
So my configuration file is like this;
server_name foo.bar.com
location /app1/ {
proxy_pass http://127.0.0.1:5000/;
}
location /app2/ {
proxy_pass http://127.0.0.1:6000/;
}
...
They work mostly fine, but there's a problem with one app.
It's a nodejs application and it has some functions like location.href = "/baz" that change current session's url from http://foo.bar.com/app into http://foo.bar.com/baz and cause Not Found errors.
That application is quite complicated and not written by me, so modifying it is quite hard.
Is there any way to change the application's base url into http://foo.bar.com/ so that make it work as http://foo.bar.com/app/baz, not http://foo.bar.com/baz?