Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Redirect loop when nginx does not forward protocol scheme #366

Open
michaelmcmillan opened this issue Mar 26, 2020 · 2 comments
Open

Redirect loop when nginx does not forward protocol scheme #366

michaelmcmillan opened this issue Mar 26, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@michaelmcmillan
Copy link
Member

server {
    server_name coronastatus.fr www.coronastatus.fr;

    location / {
        proxy_pass http://127.0.0.1:5000;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme; <-- Must be added
    }

    error_page 502 /502.html;
    location = /502.html {
      root  /var/www/html;
    }
    error_page 401 /401.html;
    location = /401.html {
      root  /var/www/html;
    }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/coronastatus.fr/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/coronastatus.fr/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
@fossecode fossecode added the bug Something isn't working label Mar 26, 2020
@aolieman
Copy link

I'm getting a "too many redirects" error, and am wondering if this might be the cause. I already reported this on Twitter. Subscribing here so I can try again when something changes on your end.

@michaelmcmillan
Copy link
Member Author

@zerbfra

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants