Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

added 'Reverse proxy' section

Blue Mousec77e153e7bbf
diff --git a/docs/selfhosting/how-to.md b/docs/selfhosting/how-to.md
index 5f4903425..79429d8c3 100644
--- a/docs/selfhosting/how-to.md
+++ b/docs/selfhosting/how-to.md
@@ -65,3 +65,10 @@ Then restart the container:
```bash
docker-compose restart
```
+
+## Reverse proxy
+Make sure to set up your reverse proxy to pass the request IP address as an `x-forwarded-for` header, otherwise it may cause the issues related to API routes rate-limiting and analytics sessions.
+
+The API depends on several Cloudflare headers (`cf-ipcountry` and `cf-connecting-ip` as a backup), so ideally you should use it too. The Swetrix Cloud API is covered by the Cloudflare proxying.
+
+You can also find some `nginx` configuration examples [here](https://github.com/Swetrix/swetrix-api/blob/main/meta/nginx/swetrix).