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!

Explain selfhosting common issues

Blue Mouse9716836ff5c6
diff --git a/docs/selfhosting/configuring.md b/docs/selfhosting/configuring.md
index 5a57e99be..23749938a 100644
--- a/docs/selfhosting/configuring.md
+++ b/docs/selfhosting/configuring.md
@@ -23,6 +23,10 @@ So if you're self-hosting on subdomains, you might run swetrix.mydomain.com prox
This is the most common issue users encounter when self-hosting Swetrix Community Edition, so please make sure to set it correctly.
:::
+:::tip
+The `API_URL` must be publicly reachable from your users' browsers. Do not set it to a Docker network hostname like `http://swetrix-api:8080` or `http://swetrix-api:5005`. Use a public domain or IP that resolves from the internet, for example `https://api.example.com`.
+:::
+
## Backend (swetrix-api image)
### Basic configuration
diff --git a/docs/selfhosting/how-to.md b/docs/selfhosting/how-to.md
index 48dd5ec28..e009cde3d 100644
--- a/docs/selfhosting/how-to.md
+++ b/docs/selfhosting/how-to.md
@@ -75,3 +75,7 @@ To update Swetrix to the latest version, please refer to the changelog on our [G
If you use reverse proxy like Nginx, please set it up to pass the request IP address as the `x-real-ip` header, otherwise it may cause the problems related to API route rate limiting and analytics sessions. If the `x-real-ip` header is undefined, Swetrix will use `x-forwarded-for` or the request IP address as a backup.
If you are using Cloudflare as a proxy for your self-hosted Swetrix instance, you can set the `CLOUDFLARE_PROXY_ENABLED` environment variable to `true`. This will force Swetrix to check the `cf-connecting-ip` header for the IP address.
+
+:::caution
+If you use Cloudflare Tunnel, avoid nested subdomains such as `api.swetrix.example.com` which may not be supported in some Tunnel setups. Prefer a single-label subdomain like `swetrixapi.example.com`, and set `API_URL` to that public URL.
+:::