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

Redirect loop when nginx does not forward protocol scheme #366

@michaelmcmillan

Description

@michaelmcmillan
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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions