报错
E1115 18:35:27.342087 34 upgradeaware.go:338] Proxy upgrade error: invalid upgrade response: status code 200
正确配置
server {
listen 443;
server_name rancher.sundayhk.com;
ssl on;
ssl_certificate /data/ssl/acme/sundayhk.com.pem;
ssl_certificate_key /data/ssl/acme/sundayhk.com.key;
include other/ssl.conf;
location / {
proxy_pass https://192.168.10.220:443;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
vim /etc/nginx/nginx.conf
http {
...
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
}