用了https后,需要用nginx作websocket地址的转发才能使用wss,别直接用端口访问
location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://localhost:10001/ws/;
}
用了https后,需要用nginx作websocket地址的转发才能使用wss,别直接用端口访问
location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://localhost:10001/ws/;
}