0


nginx转发https:SSL_do_handshake() failed

大概情况:前端项目是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;
}

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

标签: nginx https ssl

本文转载自: https://blog.csdn.net/weixin_42612454/article/details/128203273
版权归原作者 丶spare 所有, 如有侵权,请联系我们删除。

“nginx转发https:SSL_do_handshake() failed”的评论:

还没有评论