访问https域时,上游从上游读取响应头时,上游没有发送有效的HTTP / 1.0头

时间:2019-06-11 02:05:13

标签: nginx https

当访问我的域https://rancher1.208.com,the时,docker的nginx抛出此错误:

2019/06/11 00:19:42 [error] 6#6: *40 upstream sent no valid HTTP/1.0 header while reading response header from upstream, client: 101.24.11.112, server: rancher.208.com, request: "GET / HTTP/1.1", upstream: "http://172.19.104.231:4431/", host: "rancher1.208.com"

这是我的ssl配置:

    listen 443 ssl;
    listen [::]:443 ssl;
    ssl_certificate /etc/nginx/conf.d/cert/rancher1.208.com/fullchain1.pem;
    ssl_certificate_key /etc/nginx/conf.d/cert/rancher1.208.com/privkey1.pem;

    server_name rancher1.208.com;

出了什么问题?我应该将80重定向到443吗?

1 个答案:

答案 0 :(得分:0)

检查您的代理地址以使用https:

location / {
        proxy_pass https://rancher;
        index index.html index.htm;
    }

请注意proxy_pass是https而不是http。