Added documentation about the TRUSTED_HOSTS env and add it to installation guides

This commit is contained in:
Jan Böhmer 2026-07-19 21:40:26 +02:00
parent 43ac8c23c7
commit 9fb69bfc03
4 changed files with 45 additions and 6 deletions

View file

@ -22,6 +22,16 @@ TRUSTED_PROXIES=192.168.2.10
Set the `DEFAULT_URI` environment variable to the URL of your Part-DB installation, available from the outside (so via
the reverse proxy).
You should also set the `TRUSTED_HOSTS` environment variable to a regex matching the host name(s) Part-DB is reachable
under via the reverse proxy, to prevent `HTTP Host header attacks`. For example, if Part-DB is reachable via
`part-db.example.invalid`, set:
```
TRUSTED_HOSTS='^(part-db\.example\.invalid)$'
```
See the [configuration options](../configuration.md) page for more information about `TRUSTED_HOSTS`.
## Part-DB in a subpath via reverse proxy
If you put Part-DB into a subpath via the reverse proxy, you have to configure your webserver to include `X-Forwarded-Prefix` in the request headers.