linux|WebSocket关于https的那些事

今天在自己的 个人服务器上部署swoole但不巧WebSocket访问不了 废话不说上代码 找到nginx配置文件
location /websocket/ {
proxy_pass http://0.0.0.0:{port};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
【linux|WebSocket关于https的那些事】

访问: wss://域名/websocket/

ok注意防火墙哦

    推荐阅读