Managed reverse proxy

Last updated:

|Edit this page

PostHog's managed reverse proxy service enables you to route traffic through PostHog's infrastructure, simplifying the deployment and management of your PostHog reverse proxy. This guide will walk you through the setup and configuration process.

Prerequisites

Before setting up the managed reverse proxy, ensure you have the following:

  • A PostHog Cloud account with the Teams add-on
  • Access to your domain's DNS settings.

Creating a managed reverse proxy

  1. Navigate to organization proxy settings
  2. Click "New Managed Proxy"
  3. Enter a subdomain that you control. For example if you run posthog on myapp.com, you could use ph.myapp.com
  4. Go to your DNS provider and create a new CNAME record:
  • The @ or target should be set to the subdomain you chose in the previous step
  • You will be shown a domain to use as the CNAME value when creating the record. It will look something like 4854cf84789d8596ad01.proxy-us.posthog.com.
  1. Wait for the proxy to be created. It will go from "Waiting", to "Issuing" and finally "Live" once everything is set up. There is no further action required after creating the DNS record.
  2. Update your PostHog snippet or SDK to use the subdomain chosen in step 3 as the api_host.

Setting DNS records in Cloudflare

If you are using Cloudflare as your DNS provider, please ensure you have disabled proxying on the CNAME record (DNS only)

Questions?

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 us.i.posthog.com or eu.i…

Read next article