From ad2a5f5447772ebd30b5c273505006cb0901116f Mon Sep 17 00:00:00 2001 From: v1adko Date: Wed, 11 Dec 2024 17:00:44 -0500 Subject: [PATCH] Update documentation regarding reverse proxy with SvelteKit on Netlify --- contents/docs/advanced/proxy/netlify.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contents/docs/advanced/proxy/netlify.mdx b/contents/docs/advanced/proxy/netlify.mdx index 020940aa4c84..4d3c55168679 100644 --- a/contents/docs/advanced/proxy/netlify.mdx +++ b/contents/docs/advanced/proxy/netlify.mdx @@ -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: