0

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.

5
  • what do you get when you access foo.bar.baz:4123/style.css ? Commented Jun 19, 2023 at 8:02
  • Where are your log entries? Commented Jun 19, 2023 at 9:27
  • @faizan I can't get a connection when I access that URL. I'm guessing that's because "base" foo.bar.baz redirects to dockercontainer:8080 (inside the custom network in Docker) but foo.bar.baz/test would've redirected to dockercontainer:4123 , different ports. Commented Jun 20, 2023 at 14:56
  • @symcbean Where would I be able to get logs about what's happening? Didn't knew that there were logs for all requests, that'd be very helpful. Commented Jun 20, 2023 at 14:57
  • The log locations (and the contents for the access_log) are defined in your nginx config. Commented Jun 20, 2023 at 15:08

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.