侧边栏壁纸
  • 累计撰写 50 篇文章
  • 累计收到 0 条评论

wss nginx配置

admin
2022-01-10 / 0 评论 / 372 阅读 / 正在检测是否收录...

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

评论 (0)

取消