Using Cloudflare as a reverse proxy

Last updated:

In Cloudflare, create a new CNAME record for your domain. It should point to or depending on your region, and have proxy enabled (e.g. CNAME, e,, proxy enabled). Finally, use Page Rules to change the Host header to or depending on which PostHog region you are using.

Cloudflare does require your domain to be hosted with them, and using them does more than just proxying requests, such as blocking traffic from bots. Additionally, you must be on the Enterprise CloudFlare plan to customize the Host header.


Was this page useful?

Next article

Setting up AWS CloudFront as a reverse proxy

CloudFront can be used as a reverse proxy. Although there are multiple other options if you're using AWS . By default, CloudFront doesn't forward headers, cookies, or query parameters received from the origin that PostHog uses. To set these up, you need an "origin request policy" as in the instructions below. Create a distribution On the AWS dashboard, search for CloudFront, then create a new CloudFront distribution Set the origin domain to your PostHog instance or eu.posthog…

Read next article