`Laravel`版`小丑路人社区`改版中,与`Hyperf版小丑路人社区`数据互动,此版本改版中……尚未彻底完结!

Q:

websocket配置wss协议

1.配置正常站点

2.nginx的http内新增配置ws

map $http_upgrade $connection_upgrade {  
default upgrade;  ''      close;
}
upstream wss {  
# 这里的localhost是映射本地服务器,也可以是外网ip,9502是ws开启的端口。  
server localhost:9502;
}

3.nginx内的http下的server内新增配置

location /wss { 
  proxy_pass http://wss;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
}

切忌配置ssl证书

其他
订阅

评论记录


评论/回复