背景
1、由于联调环境需要在内网或外网使用wss,这里使用Nginx作为代理实现ws或wss。
2、WebSocket 在线测试: http://www.websocket-test.com/
使用Nginx代理ws
Nginx配置如下
server { listen 80; server_name ws.phpmianshi.com; add_header Access-Control-Allow-Origin *; location / { #添加wensocket代理 proxy_pass http://192.168.1.219:5670; #websocket服务器 proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_connect_timeout 1800s; proxy_send_timeout 1800s; proxy_read_timeout 1800s; } }
《本文》有 0 条评论