nginx之websocket(十四)

时间:2020-09-18 01:47:02   收藏:0   阅读:46

websocket 配置

   map $http_upgrade $connection_upgrade {
        default upgrade;
        ‘‘      close;
   }

   server {
       listen 80;
       server_name localhost;
       
       location /ws {
           proxy_pass xxx;
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection $connection_upgrade;
       }   
   }
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!