A reverse proxy allows you to send events to PostHog Cloud using your own domain.
This means that events are sent from your own domain and are less likely to be intercepted by tracking blockers. You'll be able to capture more usage data without having to self-host PostHog.
Setting up a reverse proxy means setting up a service to redirect requests from a subdomain you choose (like e.yourdomain.com
) to PostHog. It is best practice to use a subdomain that does not include posthog
, analytics
, tracking
, or other similar words.
You then use this subdomain as your instance host in the initialization of PostHog instead of app.posthog.com
or eu.posthog.com
.
Note: PostHog Cloud requires that the proxy sets the
Host
header toeu.posthog.com
for requests sent tohttps://eu.posthog.com
andapp.posthog.com
for requests sent tohttps://app.posthog.com
.
Deploying a reverse proxy
Options for deploying a reverse proxy include: