nginx配置websocket负载均衡

原创
2017/07/02 00:06
阅读数 341
upstream test.com {
   server 192.168.1.5:9000;
     server 192.168.1.6:8000;
}

server {
    listen       80;
    server_name  test.com;
    location  ^~  /ws {
        proxy_pass http://test.com;
        proxy_redirect    off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部