Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

Add Documentation Detailing Websocket Requirement for Reverse Proxies (#1297)

Kevin745fac6438b1
diff --git a/docs/en/installation.md b/docs/en/installation.md
index 43969c67..8f0b805b 100644
--- a/docs/en/installation.md
+++ b/docs/en/installation.md
@@ -103,3 +103,25 @@ You can learn more about Docker by [reading the official Docker documentation.](
2. Extract the archive.
3. Run the `homebox` executable.
4. The web interface will be accessible on port 7745 by default. Access the page by navigating to `http://local.ip.address:7745/` (replace with the right ip address)
+
+## Reverse Proxy
+
+If you use a reverse proxy, there are a few things that need to be in place:
+
+::: warning
+Only set `HBOX_OPTIONS_TRUST_PROXY=true` when Homebox is behind a trusted reverse proxy. This setting makes the application trust proxy headers (X-Forwarded-Proto, X-Forwarded-For) which can be spoofed by clients if not protected by a reverse proxy.
+:::
+
+1. Set the `HBOX_OPTIONS_TRUST_PROXY` environment variable to `true`.
+2. Ensure the `Host` HTTP header is configured (e.g. `proxy_set_header Host $host;` for nginx).
+3. Ensure websockets are proxied properly (e.g. for nginx, add the following config in the `location` block).
+
+::: tip
+Setting websocket-specific configuration should be limited to the location that serves websockets (`/api/v1/ws`) to prevent potential issues with other site URLs.
+:::
+
+```nginx
+proxy_http_version 1.1;
+proxy_set_header Upgrade $http_upgrade;
+proxy_set_header Connection "upgrade";
+```