-
Notifications
You must be signed in to change notification settings - Fork 11
PostHog Reverse Proxy #21
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerskilo-auto-fixAuto-generated label by KiloAuto-generated label by Kilokilo-triagedAuto-generated label by KiloAuto-generated label by Kilo
Description
Integration: Inline PostHog snippet in public/posthog.js:49, loaded globally via astro.config.mjs. src/components/PostHogScript.astro is a never-imported duplicate — can be deleted. This is a static Astro site with no SSR adapter, deployed on Vercel.
Since Astro static sites have no server-side rewrite capability, use Vercel rewrites which run at the CDN/edge layer without needing an adapter:
- Create
vercel.jsonat the project root:
{
"rewrites": [
{ "source": "/ingest/static/:path*", "destination": "https://us-assets.i.posthog.com/static/:path*" },
{ "source": "/ingest/:path*", "destination": "https://us.i.posthog.com/:path*" }
]
}- Update
public/posthog.js— changeapi_hostand addui_host:
posthog.init("phc_...", {
api_host: "https://path.kilo.ai/ingest",
ui_host: "https://us.posthog.com",
// ...
});- Delete
src/components/PostHogScript.astro— dead code, never imported.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerskilo-auto-fixAuto-generated label by KiloAuto-generated label by Kilokilo-triagedAuto-generated label by KiloAuto-generated label by Kilo