GatewayWorker 做负载均衡,服务器报告错误error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request

mp3aaa

如果不使用nginx反向代理,直接公网链接 wss:// 其中一台服务器没有问题。
通过内网转发以后
#

upstream apitest_a_wss {
        #server 172.24.0.191:2345;
        server 172.24.0.193:2345;
}
    location /wss/ {
            proxy_pass http://apitest_a_wss;
            proxy_http_version 1.1;
            proxy_redirect off;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_read_timeout 3600s;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
    }

使用 wss://xxxx.cn/wss 访问客户端会报告 101 xxxx 502 bad ....
服务端上的gatewayworker进程会报告
SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request

代码配置 $gateway->lanIp 和 $gateway->registerAddress 都改成了内网地址

809 1 0
1个回答

mp3aaa

问题解决了 原来是 proxy_pass http://apitest_a_wss; 改成 proxy_pass https://apitest_a_wss;
就可以了;

  • 暂无评论
年代过于久远,无法发表回答
🔝