nginx.conf 的 http 段中:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
vhost.conf 中:
location / {
proxy_pass http://127.0.0.1:9875;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}