nginx之websocket(十四)

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;
       }   
   }
posted @ 2020-09-15 09:04  pengsn  阅读(144)  评论(0编辑  收藏  举报