We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题,目前实现的项目需要两种协议,但不想使用两个端口
The text was updated successfully, but these errors were encountered:
可以前置 nginx 解决,例如(nginx 配置):
# https 和 wss server { server_name xxx.cn; listen 443 ssl; ssl on; ssl_certificate /etc/nginx/cert/k8w.cn.pem; ssl_certificate_key /etc/nginx/cert/k8w.cn.key; # https (Server 是 http) location /match-server/ { proxy_set_header Access-Control-Allow-Origin *; proxy_pass http://127.0.0.1:3200; } # wss (Server 是 ws) location /room-server/1/ { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header X-Forwarded-For $remote_addr; proxy_pass http://127.0.0.1:3201; } } # http 和 ws server { server_name xxx.cn; listen 80; # http (Server 是 http) 跟上面一样 location /match-server/ { proxy_set_header Access-Control-Allow-Origin *; proxy_pass http://127.0.0.1:3200; } # ws (Server 是 ws) 跟上面一样 location /room-server/1/ { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header X-Forwarded-For $remote_addr; proxy_pass http://127.0.0.1:3201; } }
Sorry, something went wrong.
Thanks
No branches or pull requests
如题,目前实现的项目需要两种协议,但不想使用两个端口
The text was updated successfully, but these errors were encountered: