nginx转发websocket连接成功后又立即失败

解决办法:因为http是从1.1版本开始才增加长连接的.所有在转发时,增加proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;

  

posted @ 2023-10-31 14:28  White_白  阅读(161)  评论(0编辑  收藏  举报