Skip to content

Instantly share code, notes, and snippets.

@SergNikitin
Last active May 14, 2023 15:46
Show Gist options
  • Save SergNikitin/a976bb22ae79d97c93ce56c8cc8bd83e to your computer and use it in GitHub Desktop.
Save SergNikitin/a976bb22ae79d97c93ce56c8cc8bd83e to your computer and use it in GitHub Desktop.
Caddyfile which works as a reverse proxy for PostHog EU
my.domain.com {
header {
# Below is sufficient if you want the proxy to work
# only for requests coming from your "production" domain.
# If you'd like to test your proxy from other domains, such
# as 'localhost', you'll need to tweak this line accordingly
Access-Control-Allow-Origin https://my.domain.com
}
reverse_proxy https://eu.posthog.com:443 {
header_up Host eu.posthog.com
header_down -Access-Control-Allow-Origin
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment