nginx为workerman、socketio提供ssl

天涯浪子 提交于 2020-08-11 14:31:08
  1. 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;
}
  1. 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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!