当前位置:首页 » 《随便一记》 » 正文

nginx转发https:SSL_do_handshake() failed

18 人参与  2023年05月08日 10:49  分类 : 《随便一记》  评论

点击全文阅读


大概情况:前端项目是vue,部署到nginx,由于项目中使用了第三方接口,直接访问会存在跨域问题,所以使用nginx进行转发,但是请求的时候报错了。

错误日志

SSL_do_handshake() failed (SSL: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:SSL alert number 40) while SSL handshaking to upstream, client: 127.0.0.1, server: 127.0.0.1, request: "POST /api/test HTTP/1.1", upstream: "https://xxxx", host: "127.0.0.1", referrer: "http://127.0.0.1/"

no live upstreams while connecting to upstream, client: 127.0.0.1, server: 127.0.0.1, request: "POST /api/test HTTP/1.1", upstream: "https://xxxx", host: "127.0.0.1", referrer: "http://127.0.0.1/"

nginx配置

location /api/ {
        proxy_pass  https://xxx.com/;
}

修改后配置

location /api/ {
        proxy_pass  https://xxx.com/;
        proxy_ssl_server_name on;
        proxy_ssl_session_reuse off;
}

以上两条指令是通过查看官方文档 得知,有兴趣的可以自己去查询原理 


点击全文阅读


本文链接:http://zhangshiyu.com/post/61518.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1