Nginx上游到https主机-ssl3_get_record:版本号错误

时间:2018-11-11 04:23:16

标签: ssl nginx https

我正在尝试将请求代理到远程服务器,这就是我配置Nginx的方式

upstream myupstream {
  server remote-hostname;
}

...

location ~ ^/(v1|v2|v3)/.*$ {

    proxy_pass https://myupstream;

    # also tried these options:
    # proxy_ssl_server_name on;
    # proxy_ssl_verify off;
    # proxy_set_header Host <remote-hostname-here>;
    # proxy_set_header X_FORWARDED_PROTO https;
}

结果是我看到错误502页面,并且该记录在error.log中

2018/11/10 19:41:38 [error] 8410#8410: *1 SSL_do_handshake() failed 
(SSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number) 
while SSL handshaking to upstream, client: 127.0.0.1, server: <my-web-host-here>, 
request: "GET /v1/some/page HTTP/1.1", 
upstream: "https://<my-web-host-ip-here>:80/v1/some/page", 
host: "<my-web-host-here>"

是什么原因造成的?

注意:此Nginx代理位于我的本地计算机上。

1 个答案:

答案 0 :(得分:5)

document.body.insertAdjacentHTML('beforeend', '<br>');

对我来说,目前尚不清楚您要实现的目标。但是在端口80上拥有HTTPS服务器的可能性很小。端口80通常由HTTP而非HTTPS使用。尝试通过HTTPS访问它通常会导致服务器发出HTTP错误响应,而当将其解释为预期的TLS握手响应时,则会导致出现奇怪的错误消息,例如upstream: "https://<my-web-host-ip-here>:80/v1/some/page",

相关问题