0

I have a nginx reverse proxy configured in front of a webapp.

It's currently functional but there is a bug that when a user refreshes the page the page returns a 404 if their page is not the homescreen.

EG:
http://game.com refreshes fine
http://game.com/users breaks and returns a 404

reverseproxy.conf below, any help is much appreciated!

server {
        listen 80;
        server_name game.com;
        location / {
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_buffering off;
                proxy_pass http://0.0.0.0:5000/;
        }
}

Note that there is a websocket configured for real-time updates so it's not necessary for the user to refresh the page, but it has caused some hiccups in the past

1 Answers1

1

You can try to change proxy_pass http://0.0.0.0:5000/; into proxy_pass http://0.0.0.0:5000;.

nginx will pass $request_uri to your reverse proxy.

http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass

minish
  • 626
  • 3
  • 10
  • Hey @minish, Gave that one a shot and got no luck, thanks anyway. I ended up updating my server block config with "try_files $uri $uri/ /index.html;" and that fixed it. – GraycorSatoru Feb 12 '20 at 23:42