Skip to content

CORS issue for Hobby/Self-hosted #32003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
trostli opened this issue May 7, 2025 · 1 comment
Open

CORS issue for Hobby/Self-hosted #32003

trostli opened this issue May 7, 2025 · 1 comment
Labels
bug Something isn't working right

Comments

@trostli
Copy link

trostli commented May 7, 2025

Bug Description

After deploying a copy of a self-hosted/hobby install and setting up the JS snippet correctly, I see the following JS console errors:

Access to fetch at 'https://posthog.example.com/i/v0/e/?retry_count=1&ip=1&_=1746582443868&ver=1.240.0&compression=gzip-js' from origin 'https://example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
(index):208 
POST https://posthog.example.com/i/v0/e/?retry_count=1&ip=1&_=1746582443868&ver=1.240.0&compression=gzip-js net::ERR_FAILED 403 (Forbidden)

I've made sure to set the domain where the JS snippet is installed as an authorized domain under the Web Analytics settings. I see this both on localhost as well as on my live domain. The errors log repeatedly even with no interaction by the user, like scrolling or clicking.

What could be going wrong?

I am running the latest docker image for hobby installs

Debug info

- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables or https://eu.posthog.com/settings/project-details#variables]
- [X] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]
@trostli trostli added the bug Something isn't working right label May 7, 2025
@jShox
Copy link

jShox commented May 7, 2025

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

No branches or pull requests

2 participants