Skip to content

Commit

Permalink
Add SSL Proxy settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tudoramariei committed Feb 19, 2024
1 parent 29c6ae0 commit a5da1b1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/redirectioneaza/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
DATA_UPLOAD_MAX_NUMBER_FIELDS=(int, 1000),
OLD_SESSION_KEY=(str, ""),
LOG_LEVEL=(str, "INFO"),
# proxy headers
USE_PROXY_FORWARDED_HOST=(bool, False),
PROXY_SSL_HEADER=(str, "HTTP_CLOUDFRONT_FORWARDED_PROTO"),
# db settings
DATABASE_ENGINE=(str, "sqlite3"),
DATABASE_NAME=(str, "default"),
Expand Down Expand Up @@ -127,6 +130,11 @@

DATA_UPLOAD_MAX_NUMBER_FIELDS = env.int("DATA_UPLOAD_MAX_NUMBER_FIELDS")

# Proxy HOST & Scheme headers
USE_X_FORWARDED_HOST = env.bool("USE_PROXY_FORWARDED_HOST", False)
if proxy_ssl_header_name := env.str("PROXY_SSL_HEADER", ""):
SECURE_PROXY_SSL_HEADER = (proxy_ssl_header_name, "https")

# superuser/admin seed data
DJANGO_ADMIN_PASSWORD = env.str("DJANGO_ADMIN_PASSWORD", None)
DJANGO_ADMIN_EMAIL = env.str("DJANGO_ADMIN_EMAIL", None)
Expand Down

0 comments on commit a5da1b1

Please sign in to comment.