wss匹配需要包含在server{}内
location /wss {
add_header Access-Control-Allow-Origin *;
proxy_redirect off;
proxy_pass http://wss_8;
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
upstream跟server配置同级
upstream wss_8{
server 127.0.0.1:8099;
}
评论 (0)