nginx proxy web socket error "WebSocket is already in CLO

nginx 代理 web socket 报错“WebSocket is already in CLOSING or CLOSED state.”

In the production environment, you need to use nginx to proxy websocket. After following the normal configuration, it is found that the browser keeps prompting "WebSocket is already in CLOSING or CLOSED state."

This is because nginx needs to add the following two parameters to the proxy

           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";

Plus the following parameters are normal

Guess you like

Origin blog.51cto.com/13447608/2541991