Nginx上游到https主机-ssl3_get_record:版本号错误 [英] Nginx upstream to https host - ssl3_get_record:wrong version number

查看:1919
本文介绍了Nginx上游到https主机-ssl3_get_record:版本号错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to proxy requests to a remote server, this is how I configure my 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中

As a result I see error 502 page and this record in 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代理位于我的本地计算机上.

Note: This nginx proxy is on my local machine.

推荐答案

upstream: "https://<my-web-host-ip-here>:80/v1/some/page", 

对我来说,你目前正在努力实现的目标还不是很清楚.但是,不太可能在端口80上具有HTTPS服务器.端口80通常由HTTP而非HTTPS使用.尝试通过HTTPS访问它通常会导致服务器发出HTTP错误响应,当将其解释为预期的TLS握手响应时,将导致奇怪的错误消息,如ssl3_get_record:wrong version number.

It is not really clear to me what you are trying to achieve. But it is very unlikely that you have a HTTPS server on port 80. Port 80 is commonly used by HTTP not HTTPS. Trying to access it by HTTPS will usually result in a HTTP error response by the server which, when interpreted as the expected TLS handshake response, will result in strange error messages like ssl3_get_record:wrong version number.

这篇关于Nginx上游到https主机-ssl3_get_record:版本号错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆