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!

ignore x-real-ip

Blue Mousee5750c22cd48
diff --git a/apps/production/src/common/utils.ts b/apps/production/src/common/utils.ts
index f6a570876..990cb65af 100644
--- a/apps/production/src/common/utils.ts
+++ b/apps/production/src/common/utils.ts
@@ -227,13 +227,14 @@ const getIPFromHeaders = (headers: any, tryXClientIPAddress?: boolean) => {
}
// Get IP based on the NGINX configuration
- let ip = headers['x-real-ip']
+ // No need to do this if API is behind a load balancer
+ // let ip = headers['x-real-ip']
- if (ip) {
- return ip
- }
+ // if (ip) {
+ // return ip
+ // }
- ip = headers['x-forwarded-for'] || null
+ const ip = headers['x-forwarded-for'] || null
if (!ip) {
return null