我让nginx监听端口<public_ip>:443。它同时获得wss和https请求。
我已经将https流量重定向到localhost:3000。
可以将wss重定向到localhost:10443
https://balbla.com:443 -> NGINX -> http://localhost:3000
wss://blabla.com:443 -> NGINX -> wss://localhost:10443发布于 2019-05-10 14:57:56
我认为如果你把websocket connect放在URL后面是可能的。使用以下配置,您可以通过WSS ://hostname/websocket/连接wss:
location /websocket/ {
proxy_pass http://localhost:10443;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}https://stackoverflow.com/questions/56071308
复制相似问题