coronastatus
coronastatus copied to clipboard
Redirect loop when nginx does not forward protocol scheme
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
}
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.
@zerbfra