前言
前几天,写了一篇《宝塔快速反代openai官方的API接口,实现国内直接使用ChatGPT》,直接把我一个闲置的域名反代了api.openai.com,从而实现了国内直接使用ChatGPT的目的,但是有网友给博主反映,我的API反代地址502 Bad Gateway了。

排查
先要找到问题所在,看了一下日志,当然给ChatGPT自己看咯

应该是SSL证书握手的时候,不匹配,造成握手失败
解决
打开站点——反向代理——配置文件——添加两行代码——保存

代码如下:
proxy_ssl_server_name on;
proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
正常

修改后,能正常打开了,至此已解决。
总结
反代的时候,没有强制打开SSL及指定协议,导致SSL握手失败,在反代的配置里打开,正常了。
暂无评论