From 5f86253b947b2972cb4046489e82aa6cb4c5b582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 11 Nov 2023 23:03:29 +0100 Subject: [PATCH] Add documentation on how to put Part-DB into a subpath of a reverse proxy This fixes issue #428 --- docs/installation/reverse-proxy.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/installation/reverse-proxy.md b/docs/installation/reverse-proxy.md index 66a18201..605b93fa 100644 --- a/docs/installation/reverse-proxy.md +++ b/docs/installation/reverse-proxy.md @@ -20,4 +20,21 @@ 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). \ No newline at end of file +the reverse proxy). + +## 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. +For example if you put Part-DB behind a reverse proxy with the URL `https://example.com/partdb`, you have to set the `X-Forwarded-Prefix` header to `/partdb`. + +In apache, you can do this by adding the following line to your virtual host configuration: + +``` +RequestHeader set X-Forwarded-Prefix "/partdb" +``` + +and in nginx, you can do this by adding the following line to your server configuration: + +``` +proxy_set_header X-Forwarded-Prefix "/partdb"; +``` \ No newline at end of file