修改宝塔面板配置文件:
添加这几行代码:
location /wss{proxy_pass http://127.0.0.1:23481; # 根据自己的socket端口号修改proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "Upgrade";proxy_set_header X-Real-IP $remote_addr;}
搜索websocket在线测试工具http://www.websocket-test.com/,输入wss://域名/wss
上图显示连接成功