Skip to content

Commit

Permalink
Allow to log real client ip in logs when using a reverse proxy (#398)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
fmenabe and sissbruecker authored May 18, 2023
1 parent d1819c6 commit a94eb5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

### `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`

Values: `postgres` or `sqlite` | Default = `sqlite`
Expand Down
6 changes: 5 additions & 1 deletion uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ if-env = LD_REQUEST_TIMEOUT
http-timeout = %(_)
socket-timeout = %(_)
harakiri = %(_)
endif =
endif =

if-env = LD_LOG_X_FORWARDED_FOR
log-x-forwarded-for = %(_)
endif =

0 comments on commit a94eb5f

Please sign in to comment.