Since yesterday we have had a problem with WebSocket connections. The chromium-based browser and also Firefox don't add Sec-WebSocket-Key into the headers during connection. We use the standard new WebSocket() to connect with the server.
Missing header Sec-WebSocket-Key header

Funny thing is that when I open a new incognito window I can create a connection but after some fetch() request if I will try to make another connection it will fail - missing Sec-Websocket-Key header.
Failed WebSockect connection after a fetch request
Second WebSocket connection - missing Sec-WebSocket-Key
Nginx config for /ws.
location ^~ /ws {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://backend;
}
Has anyone encountered a similar problem?
Checked in Google Chrome Version 96.0.4664.93 and Firefox 95.0.1 Windows, Linux and Mac.
MacOS & Safari works.


