nginx ws长连接配置
http根节点下配上
map $http_upgrade $connection_upgrade {default upgrade;'' close;}
如下:
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/be96b5dee77c4b95af0e106c27679535.png)
server服务节点下,后端接口的代理配置
proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection $connection_upgrade;proxy_set_header Host $host;
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/8840c60f2b02449b96394a540208825b.png)