美文网首页
nginx代理ws协议

nginx代理ws协议

作者: 博楠同学 | 来源:发表于2019-04-23 11:14 被阅读0次
    server {
        listen 443;
        root /home/sign/public/;
        server_name nh.nsfocus.com;
        location /wsapp/ {
            proxy_pass http://127.0.0.1:9501;
            proxy_redirect off;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
    
            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For   
            $proxy_add_x_forwarded_for;
            proxy_read_timeout 7200;
        }
        location /index/ {
            proxy_http_version 1.1;
            proxy_set_header Connection "keep-alive";
            proxy_set_header X-Real-IP $remote_addr;
            if (!-f $request_filename) {
                proxy_pass http://127.0.0.1:9501;
            }
        }
    }
    

    相关文章

      网友评论

          本文标题:nginx代理ws协议

          本文链接:https://www.haomeiwen.com/subject/ulamgqtx.html