Use SECURE_SSL_REDIRECT to ensure requests are routed to https always

This commit is contained in:
sabaimran
2024-04-09 10:18:12 +05:30
parent 1c229dad91
commit ab51ae9091

View File

@@ -45,9 +45,11 @@ if DEBUG or os.getenv("KHOJ_DOMAIN") == None:
SESSION_COOKIE_DOMAIN = "localhost"
CSRF_COOKIE_DOMAIN = "localhost"
else:
# Production Settings
SESSION_COOKIE_DOMAIN = KHOJ_DOMAIN
CSRF_COOKIE_DOMAIN = KHOJ_DOMAIN
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTOCOL", "https")
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True