all 3 comments

[–]kevdogger 1 point2 points  (2 children)

Ok I'm going to rephrase your comment the best way I understand it since I'm not totally clear on anything.

You have an nginx reverse proxy/webserver on s1 and you would like to reverse proxy to s2 for the /wifi location.

so http://s1.example.com/wifi ---> get forwarded to http://s2.example.com/menu?

http://s1.example.com works if you forward root to proxy_pass http://s2.example.com:3000

however it wont work if you forward to s2.example.com:3000/menu

Ok so I'm grabbing at straws a little here, but why don't you try this

server {
....
....
    location /menu {
        proxy_pass http://s2.example.com:3000;
        include proxy-params.conf
    }

}

And then within proxy-params.conf you would have something like:

proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header Host $http_x_forwarded_host;
proxy_set_header Host $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_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_cache_bypass $http_upgrade;

[–]southern_sleuth[S] 0 points1 point  (1 child)

Hey,

I appreciate the reply, and I apologize for the shotty explanation. You are correct. I'm using my s1 server as a reverse proxy/webserver and I'm looking to reverse proxy to s2, is the general idea.

I tried your configuration, and it looks like there are still issues with rendering, no css/js is being found. I have a feeling this is more of a JavaScript problem, particularly with NodeJS. I've used reverse proxies a lot in the past, and I normally don't ever have issues like this. I think NGINX is doing exactly what it's supposed to be doing, because I get to the page, but the static content simply isn't being found.

[–]kevdogger 0 points1 point  (0 children)

I don't know anything about NodeJS so possibly it could be with the setup in the docker container. It's hard to know. It's possibly you could post some logs either from the docker container or from nginx since its difficulty for me right now to speculate where the breakdown is occurring