Skip to content
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

Update documentation regarding reverse proxy with SvelteKit on Netlify #10117

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions contents/docs/advanced/proxy/netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ Netlify supports [redirects and rewrites](https://docs.netlify.com/routing/redir
force = true
```

> **Note:** If deploying SvelteKit on Netlify use `_redirects` file and place it in `static` folder, as redirects in `netlify.toml` configuration [are not supported](https://docs.netlify.com/frameworks/sveltekit/#limitations).

```js
/ingest/static/* https://us-assets.i.posthog.com/static/:splat 200!
/ingest/* https://us.i.posthog.com/:splat 200!
```

> **Note:** This proxy configuration works with custom domains but may not work correctly with the default `.netlify.app` domain. If you're experiencing issues with PostHog requests being blocked, ensure you're using a custom domain rather than the default Netlify domain.

Once done, set the `/ingest` route of your domain as the API host in your PostHog initialization like this:
Expand Down