diff --git a/flashy/settings.py b/flashy/settings.py index 36dca38..b0aac47 100644 --- a/flashy/settings.py +++ b/flashy/settings.py @@ -97,6 +97,7 @@ if IN_PRODUCTION: if IN_PRODUCTION: SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True + SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # are we secure yet? SECRET_KEY = os.environ.get('SECRET_KEY', 'LOL DEFAULT SECRET KEY') diff --git a/nginxconf/flashy.cards b/nginxconf/flashy.cards index 3c59fab..ab1b1a0 100644 --- a/nginxconf/flashy.cards +++ b/nginxconf/flashy.cards @@ -26,6 +26,7 @@ server { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; } location ^~ /jenkins { @@ -34,6 +35,7 @@ server { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 90; } ssl_certificate /etc/nginx/ssl/bundle.crt;