I have several services I'm placing behind an NGINX reverse proxy, which was simple enough to setup, but I've run into a problem with websockets. A single endpoint is simple enough to specify with a location that includes
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
The problem is that there are many endpoints with websockets. And we keep finding new things that don't work because there's yet another websocket endpoint we didn't know about.
Is there a way to only set the Upgrade
and Connection
header if the client passes it? If I include those two lines for the whole service it attempts to upgrade every connection, not just the websockets.