WebSocket高可用nginx负载均衡配置
map $http_upgrade $connection_upgrade { default upgrade; '' close; } #ip_hash可以固定指向固定服务器,防止每次ws请求分发到不同的服务器上 upstream websocket { ip_hash; server localhost:9003; server localhost:9006; } #websocket location /webSockPoint { proxy_pass http://websocket; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Origin ""; }
WebSocket高可用nginx负载均衡配置
最新推荐文章于 2023-06-26 17:24:52 发布