开发者社区 问答 正文

php nginx websocket?报错

php nginx websocket

报错

'ws://47.98.170.9:1170/' failed: Error during WebSocket handshake: Unexpected response code: 200

proxy_redirect      off;
            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    X-Forwarded-Proto $scheme;
      
                  #proxy_pass http://47.98.133.36;
                  proxy_http_version 1.1;
                  proxy_set_header    Upgrade $http_upgrade;
                  proxy_set_header    Connection "upgrade";
      
                  proxy_buffering     off;
      
                  proxy_connect_timeout 43200000;
                  proxy_read_timeout    43200000;
                  proxy_send_timeout    43200000;

 

展开
收起
爱吃鱼的程序员 2020-06-07 17:11:15 619 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <p>后端支持websocket的话,响应状态码应该是101</p>
    
    2020-06-07 17:11:30 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论