Martin
CDCloudflare Developers
•Created by Martin on 5/31/2024 in #general-help
Posthog visitor IPs show as Cloudflare IPs
Hey there,
I have an Astro project deployed on vercel and I use the Cloudflare proxy mode. However, for every posthog visitor it shows the cloudflare IP, even though I have set up
X-Forwarded-For
in my vercel.json
:
{
"rewrites": [
{
"source": "/ingest/static/:path(.*)",
"destination": "https://eu-assets.i.posthog.com/static/:path*"
},
{
"source": "/ingest/:path(.*)",
"destination": "https://eu.i.posthog.com/:path*"
}
],
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "X-Real-IP",
"value": "{%CF-Connecting-IP%}"
},
{
"key": "X-Forwarded-For",
"value": "{%CF-Connecting-IP%}"
}
]
}
]
}
Any idea how to fix it?2 replies