首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
swoole_websocket_server nginx设置
微信小程序中请求websocket的时候是不允许加端口号的。 假设server: $ws = new swoole_websocket_server("0.0.0.0", 9502, SWOOLE_BASE, SWOOLE_SOCK_TCP | SWOOLE_SSL); 希望nginx中应该怎样设置。 目前已经尝试了很多次,例如:我希望 wss://xxx.com/wss location ^~ /wss { proxy_pass http://127.0.0.1:9502/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_connect_timeout 60; proxy_send_timeout 60; proxy_read_timeout 3000; } 但总是失败。求问该怎么设置
发布于7年前 · 4 次浏览 · 来自
提问
B
BetterCuicui
微信小程序中请求websocket的时候是不允许加端口号的。 假设server: $ws = new swoole_websocket_server("0.0.0.0", 9502, SWOOLE_BASE, SWOOLE_SOCK_TCP | SWOOLE_SSL); 希望nginx中应该怎样设置。 目前已经尝试了很多次,例如:我希望 wss://xxx.com/wss location ^~ /wss { proxy_pass http://127.0.0.1:9502/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_connect_timeout 60; proxy_send_timeout 60; proxy_read_timeout 3000; } 但总是失败。求问该怎么设置
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2018-12-05
用
用xin-倾听
我的目前在用的配置 {{{ # WebScoket转发 location /im { proxy_read_timeout 300s; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-Port $remote_port; proxy_set_header X-Forwar
赞
0
回复