修改nginx配置
1.在service上面添加
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
2.在service里面添加
location /wsapi {
rewrite ^/wsapi/(.*)$ /$1 break;
proxy_pass http://127.0.0.1:24445/agentServer;
proxy_http_version 1.1;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host:$server_port;
}
3.ws写法
ws://127.0.0.1:8080/wsapi/agentServer/