nginx ws长连接配置 http根节点下配上 map $http_upgrade $connection_upgrade { default upgrade; '' close; } 如下: server服务节点下,后端接口的代理配置 proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Host $host;