- nginx
location /wss
{
proxy_pass http://127.0.0.1:3322;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
}
location /socket.io
{
proxy_pass http://127.0.0.1:3310;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Real-IP $remote_addr;
}
- apache
# Proxy Config
ProxyRequests Off
ProxyPass /wss ws://127.0.0.1:3322
ProxyPassReverse /wss ws://127.0.0.1:3322
ProxyPass /socket.io http://127.0.0.1:3310
ProxyPassReverse /socket.io http://127.0.0.1:3310
来源:oschina
链接:https://my.oschina.net/u/2266306/blog/4316370