Skip to content

Commit 51c571e

Browse files
committed
Set SECURE_PROXY_SSL_HEADER and X-Forwarded-Proto header #384
Signed-off-by: Thomas Druez <tdruez@nexb.com>
1 parent 74a4b2e commit 51c571e

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

etc/nginx/conf.d/default.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ server {
88
location / {
99
proxy_pass http://gunicorn_app;
1010
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
11+
proxy_set_header X-Forwarded-Proto https;
1112
proxy_set_header Host $host;
1213
proxy_redirect off;
1314
client_max_body_size 10G;

etc/nginx/examples/ssl.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ server {
1515
location / {
1616
proxy_pass http://gunicorn_app;
1717
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
18+
proxy_set_header X-Forwarded-Proto https;
1819
proxy_set_header Host $host;
1920
proxy_redirect off;
2021
client_max_body_size 10G;

scancodeio/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@
108108

109109
WSGI_APPLICATION = "scancodeio.wsgi.application"
110110

111+
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
112+
111113
# Database
112114

113115
DATABASES = {

0 commit comments

Comments
 (0)