diff --git a/.env.example b/.env.example index 98a6a7b..efe371a 100644 --- a/.env.example +++ b/.env.example @@ -14,4 +14,7 @@ DATABASE_URL = 'postgres://{user}:{password}@{hostname}:{port}/{database-name}' # for google recaptcha 2 # DJANGO_CBREADER_USE_RECAPTCHA = True # DJANGO_RECAPTCHA_PRIVATE_KEY = '' -# DJANGO_RECAPTCHA_PUBLIC_KEY = '' \ No newline at end of file +# DJANGO_RECAPTCHA_PUBLIC_KEY = '' + +# Uncomment the following is using a reverse proxy. +# USE_X_FORWARDED_HOST=True \ No newline at end of file diff --git a/cbreader/settings/base.py b/cbreader/settings/base.py index cd924b3..9c3042e 100644 --- a/cbreader/settings/base.py +++ b/cbreader/settings/base.py @@ -116,4 +116,8 @@ COMIC_DIR = "/media/comics" from .logger import LOGGING -SILK_ENABLED = False \ No newline at end of file +SILK_ENABLED = False + +USE_X_FORWARDED_HOST = os.getenv('USE_X_FORWARDED_HOST', False) == 'True' + +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')