fix: canonical в продакшен не должен показывать http вместо https

This commit is contained in:
2026-03-05 13:44:33 +03:00
parent f64b7d8799
commit 6b6f294c9b
2 changed files with 8 additions and 0 deletions

View File

@@ -114,6 +114,7 @@ http {
proxy_pass http://app_server; proxy_pass http://app_server;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_redirect off; proxy_redirect off;
} }

View File

@@ -140,3 +140,10 @@ MEDIA_URL = '/media/'
# https://docs.djangoproject.com/en/6.0/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/6.0/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# Настройки безопасности для работы за прокси
if not DEBUG:
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True