WebSocket系列教材 (四)- nginx 注意事项

 

步骤1:nginx.conf

步骤 1 : nginx.conf

如果做了nginx和tomcat整合的话,那么nginx 需要加上这么一段话,才能够正常的把webSocket请求交给tomcat,不然tomcat也不知道怎么处理

location /ws/ {

        proxy_pass http://127.0.0.1:11180;

        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection "upgrade";

}


更多内容,点击了解: https://how2j.cn/k/websocket/websocket-nginx/1627.html

posted @ 2020-05-07 09:19  Lan_ht2  阅读(104)  评论(0)    收藏  举报