nginx 反向代理wss ,报104: Connection reset by peer

mingzhi

最近我们迁移了服务器,之前配置过wss,参考:http://wenda.workerman.net/?/question/1485 ,是成功的,但迁移的新的服务器之后,一直报:

2017/09/15 23:00:58  11891#0: *1262 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 123.112.94.16, server: xxxxx, request: "GET /wss/ HTTP/1.1", upstream: "http://127.0.0.1:7777/", host: "xxxx", referrer: "https://servicewechat.com/wxe55e919621f320a0/devtools/page-frame.html"

查看状态也没有错误,端口也是正常启动的。

----------------------------------------------GLOBAL STATUS----------------------------------------------------
Workerman version:3.5.1          PHP version:5.5.37
start time:2017-09-15 23:02:57   run 0 days 0 hours
load average: 0, 0, 0            event-loop:\Workerman\Events\Select
2 workers       4 processes
worker_name        exit_status      exit_count
ChatBusinessWorker 0                0
ChatGateway        0                0
----------------------------------------------PROCESS STATUS---------------------------------------------------
pid memory  listening                worker_name        connections total_request send_fail timers   status
12099   2.5M    none                     ChatBusinessWorker 1           0             0         1        
12100   2.5M    none                     ChatBusinessWorker 1           0             0         1        
12101   1.25M   websocket://0.0.0.0:7777 ChatGateway        1           0             0         2        
12102   1.25M   websocket://0.0.0.0:7777 ChatGateway        1           0             0         2        
``

使用telnet 访问,直接连接不了
```sh
# telnet 127.0.0.1 7777
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.

nginx 配置:

 location /wss/
        {
                proxy_pass http://127.0.0.1:7777;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                rewrite /wss/(.*) /$1 break;
                proxy_redirect off;
        }

现在都找不到问题所在,求帮助解决。

9704 1 0
1个回答

xiuwang

目测貌似缺个Reigster进程?

年代过于久远,无法发表回答
×
🔝