"Handshake failed due to invalid Upgrade header: null"
If your WebSocket is behind a proxy (like Nginx, Apache, or Cloudflare), the proxy might not be correctly forwarding the Upgrade headers.
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:3001;
proxy_redirect off;
charset utf-8;
}
nginx 설정 Upgrade 추가


