ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersโ€ข2y agoโ€ข
1 reply
Martin

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
X-Forwarded-For
in my
vercel.json
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%}"
        }
      ]
    }
  ]
}
{
  "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?
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

cloudflare hiding visitor real ip
Cloudflare DevelopersCDCloudflare Developers / general-help
3y ago
Cloudflare edge IPs for my domain flagged as malicious
Cloudflare DevelopersCDCloudflare Developers / general-help
10mo ago
Problem with some Cloudflare IPs
Cloudflare DevelopersCDCloudflare Developers / general-help
13mo ago
Disable Cloudflare captcha for specific IPs
Cloudflare DevelopersCDCloudflare Developers / general-help
2mo ago