一:Nginx配置websocket
location /haiyiWeb_WSS {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $server_name;
proxy_connect_timeout 4s;
proxy_read_timeout 60s;
proxy_send_timeout 12s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://172.30.21.25:9997/haiyiWeb_WSS;
}
二: 负载配置
location /xxxService_JK/jk/monitorService {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $server_name;
# proxy_pass http://www.xxxx.com/xxxService_JK/jk/monitorService;
proxy_pass http://jkServer/xxxService_JK/jk/monitorService;
}
upstream jkServer {
#sticky name=esmcpjkRoute path=/xxxService_JK/jk/monitorService;
server 172.31.251.134:8881;
server 172.31.251.134:8882;
server 172.31.251.134:8883;
#ip_hash;
}