开发者社区> 问答> 正文

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 568 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <p>后端支持websocket的话,响应状态码应该是101</p>
    
    2020-06-07 17:11:30
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
阿里云栖开发者沙龙PHP技术专场-RabbitMQ 的延时队列和镜像队列原理与实战-钱文品 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载