Nginx proxy_pass keeps redirecting to localhost

nginx

I am trying to set up a reverse proxy from my domain to http://127.0.0.1:4000. My issue is that whenever I try to open https://example.com (not the actual domain) in a browser, I just get redirected to http://localhost on my own machine. There is nothing listening on the server at http://127.0.0.1:4000 yet. I am just trying to see the 504 error screen.

server {
        listen 443 ssl;

        server_name example.com;

        ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

        location / {
                proxy_pass http://127.0.0.1:4000;
        }
}

The domain does point to this server. I am able to connect to the server via this domain, but when I view it in a browser I always get redirected to http://localhost.

EDIT: I just tried it in another browser and realized it was Chrome doing the redirect. The server works fine.

Best Answer

Nevermind, I tried it in another browser and it worked fine. Chrome is just stuck redirecting me for some reason...