diff --git a/dicquo/dicquo/settings.py b/dicquo/dicquo/settings.py index 4d234c9..b0dfe54 100644 --- a/dicquo/dicquo/settings.py +++ b/dicquo/dicquo/settings.py @@ -154,3 +154,12 @@ if not DEBUG: WHITENOISE_ROOT = BASE_DIR.parent / 'public' SITE_ID = 1 + +# Настройки безопасности для работы за прокси +if not DEBUG: + SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') + SECURE_SSL_REDIRECT = True + SESSION_COOKIE_SECURE = True + CSRF_COOKIE_SECURE = True + USE_X_FORWARDED_HOST = True + USE_X_FORWARDED_PORT = True