24.06.2025・TechStuff
24.06.2025・TechStuff

Troubleshooting proxy_pass with Safari

Fabian Blechschmidt

I setup a proxy pass to have the app on one server and the hostname terminate by DNS on another machine.

Setting up a reverse proxy is pretty easy:

location /directory/ {
    proxy_pass https://192.168.1.1/;
    proxy_set_header Host example.org;
    proxy_hide_header Upgrade; # Important part for Safari
}

But for some reason, Safari doesn’t like the response.

Screenshot from Safari saying:
Safari Can't Open the Page

Safari can't open the page REDACTED because the server unexpectedly dropped the connection. This sometimes occurs when the server is busy. Wait for a few minutes, and then try again.

The important part is to NOT pass the Upgrade header on to the backend machine – don’t ask me, what is wrong with Safari, because without the configuration it still works with curl, Chrome and Paw

Hope it helps someone 🙂