This commit is contained in:
Sascha Ißbrücker
2026-01-05 09:33:27 +01:00
parent fdb5b4e82d
commit 5f5ea73aec
2 changed files with 8 additions and 11 deletions

View File

@@ -29,6 +29,13 @@ DEBUG = False
ALLOWED_HOSTS = ["*"]
USE_X_FORWARDED_HOST = os.getenv("LD_USE_X_FORWARDED_HOST", False) in (
True,
"True",
"true",
"1",
)
# Application definition
INSTALLED_APPS = [
@@ -217,16 +224,6 @@ if LD_ENABLE_AUTH_PROXY:
if LD_AUTH_PROXY_LOGOUT_URL:
LOGOUT_REDIRECT_URL = LD_AUTH_PROXY_LOGOUT_URL
LD_USE_X_FORWARDED_HOST = os.getenv("LD_USE_X_FORWARDED_HOST", False) in (
True,
"True",
"true",
"1",
)
if LD_USE_X_FORWARDED_HOST:
USE_X_FORWARDED_HOST = LD_USE_X_FORWARDED_HOST
# CSRF trusted origins
trusted_origins = os.getenv("LD_CSRF_TRUSTED_ORIGINS", "")
if trusted_origins:

View File

@@ -200,7 +200,7 @@ Values: `true` or `false` | Default = `false`
If enabled the server will trust the `X-Forwarded-Host` header over the `Host` header to determine the hostname of the server. This should only be enabled if a proxy which sets this header is in use.
This setting is adopted from the Django framework used by linkding, more information on the setting is available in the [Django documentation](https://docs.djangoproject.com/en/6.0/ref/settings/#std-setting-USE_X_FORWARDED_HOST)
This setting is adopted from the Django framework used by linkding, more information on the setting is available in the [Django documentation](https://docs.djangoproject.com/en/6.0/ref/settings/#std-setting-USE_X_FORWARDED_HOST).
### `LD_LOG_X_FORWARDED_FOR`