Dolphin
Dolphin

Reputation: 38893

upstream sent no valid HTTP/1.0 header while reading response header from upstream when access https domain

When access my domain https://rancher1.208.com,the docker's nginx throw this error:

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"

This is my ssl config:

    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;

Where is going wrong?should I redirect 80 to 443?

Upvotes: 1

Views: 9643

Answers (1)

Dolphin
Dolphin

Reputation: 38893

Check you proxy address to use https:

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

Pay attention the proxy_pass is https not http.

Upvotes: 4

Related Questions