location /webapp/ws {
                proxy_pass http://ws_gateway/ws;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_send_timeout 60;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";

        }
 

 

nginx 主配置文件添加以下内容

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

Logo

更多推荐