0%

nginx 配置

nginx 配置 websocket

1
2
3
4
5
6
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;

nginx 配置负载均衡

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
upstream k8s {
server 192.168.199.111:80;
server 192.168.199.112:80;
server 192.168.199.113:80;
}
server {
listen 80;
server_name *.ltinyho.top ltinyho.top;
location / {
proxy_pass http://k8s;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}

参考: