nginx之代理websocket

nginx代理websocket:
NGINX通过允许一个在客户端和后端服务器之间建立的隧道来支持WebSocket。
为了NGINX发送来至于客户端Upgrade请求到后端服务器,Upgrade和Connection头部必须被设置明确

server {
      listen  80;
      server_name grafana.huoqiuapp.com;
          location / {
            proxy_pass   http://10.10.111.192:8082;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;
        }
}

  

原文地址:https://www.cnblogs.com/xzlive/p/9987652.html