I'm trying to serve 2 different websites under the same subdomain depending on the location.
Using the GUI from Nginx Proxy Manager Docker container I've managed to set up the initial domain https://foo.bar.baz that redirects to another Docker container http://dockercontainer:port.
By editing the "Custom locations" tab I've been able to set up a redirect from https://foo.bar.baz/test/ to http://dockercontainer:anotherport/
However, the website isn't loading any of the resources since it doesn't seem to be redirecting the resources requests and I'm getting 404'd for requests such as https://foo.bar.baz/test/styles.css.
Current .conf relevant lines:
location /test/ {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://foo.bar.baz:4123/;
<snip>
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
}
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
# Proxy!
include conf.d/include/proxy.conf;
}
I've tried searching around for different solutions but some of them weren't relevant or similar to this case, and others were based on modifying the source code of the website, which I'm not able to do.