Serve media files under httpS:// in prod

This commit is contained in:
Michael Herrmann
2023-06-12 15:32:41 +02:00
parent 17eb067076
commit c8c291e2b8
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -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) {
+5 -1
View File
@@ -140,4 +140,8 @@ REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated'
]
}
}
# Make sure Django returns https:// URLs when invoked over https.
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')