diff --git a/conf/nginx/nginx b/conf/nginx/nginx index d4f5b2a..8c40af0 100644 --- a/conf/nginx/nginx +++ b/conf/nginx/nginx @@ -39,7 +39,7 @@ server { location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Protocol $scheme; + proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; proxy_redirect off; if (!-f $request_filename) { diff --git a/core/settings.py b/core/settings.py index 22d2741..131ac3c 100644 --- a/core/settings.py +++ b/core/settings.py @@ -140,4 +140,8 @@ REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticated' ] -} \ No newline at end of file +} + +# Make sure Django returns https:// URLs when invoked over https. +USE_X_FORWARDED_HOST = True +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') \ No newline at end of file