nginx转发https:SSL_do_handshake() failed

2023-05-16

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

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

nginx转发https:SSL_do_handshake() failed 的相关文章

随机推荐