Allow to log real client ip in logs when using a reverse proxy (#398)

* Allow to log real client ip in logs when using a reverse proxy

* rearrange options

---------

Co-authored-by: Sascha Ißbrücker <sascha.issbruecker@googlemail.com>
This commit is contained in:
François Ménabé 2023-05-18 09:34:55 +02:00 committed by GitHub
parent d1819c6503
commit a94eb5f85a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -109,6 +109,12 @@ Multiple origins can be specified by separating them with a comma (`,`).
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/4.0/ref/settings/#std-setting-CSRF_TRUSTED_ORIGINS). 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/4.0/ref/settings/#std-setting-CSRF_TRUSTED_ORIGINS).
### `LD_LOG_X_FORWARDED_FOR`
Values: `true` or `false` | Default = `false`
Set uWSGI [log-x-forwarded-for](https://uwsgi-docs.readthedocs.io/en/latest/Options.html?#log-x-forwarded-for) parameter allowing to keep the real IP of clients in logs when using a reverse proxy.
### `LD_DB_ENGINE` ### `LD_DB_ENGINE`
Values: `postgres` or `sqlite` | Default = `sqlite` Values: `postgres` or `sqlite` | Default = `sqlite`

View file

@ -22,4 +22,8 @@ if-env = LD_REQUEST_TIMEOUT
http-timeout = %(_) http-timeout = %(_)
socket-timeout = %(_) socket-timeout = %(_)
harakiri = %(_) harakiri = %(_)
endif = endif =
if-env = LD_LOG_X_FORWARDED_FOR
log-x-forwarded-for = %(_)
endif =