From f47b9eee5b13d4da8e699f9bbfa8d9a97dc359b8 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Mon, 18 Jul 2022 18:10:54 +0200 Subject: [PATCH] Added fix for "apache vs django" proxy headers --- docs/installation/apache.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/installation/apache.md b/docs/installation/apache.md index 1b423587..b31c59e9 100644 --- a/docs/installation/apache.md +++ b/docs/installation/apache.md @@ -77,3 +77,19 @@ After acquiring SSL the config file needs to be adjusted. Add the following line RequestHeader set X-FORWARDED-PROTOCOL https RequestHeader set X-FORWARDED-SSL On ``` + +### Known Issues + +#### Apache2 vs. Django + +For some versions of Apache2 you might have to tell the Django framework explicitly +to use SSL, since the automatic detection doesn't work. SSL in general will work, +but internally created URLs by Django might still be prefixed with just `http://` +instead of `https://`, so it can't hurt to add these lines to +`myauth/myauth/settings/local.py`. + +```python +# Setup support for proxy headers +USE_X_FORWARDED_HOST = True +SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTOCOL", "https") +```