1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
upstream nodes {
ip_hash;
server 192.168.1.114:3000;
server 192.168.1.114:3001;
server 192.168.1.114:3002;
}
server {
listen 80;
server_name ws;
index index.html index.htm index.php;
location /{
proxy_pass http://nodes; #反向代理集群
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
|