Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

change posthog proxy prefix

Steven Tey2a6c485c1fe5
diff --git a/apps/web/app/providers.tsx b/apps/web/app/providers.tsx
index c66b3a4c39..419061c4d2 100644
--- a/apps/web/app/providers.tsx
+++ b/apps/web/app/providers.tsx
@@ -11,7 +11,7 @@ import { ReactNode } from "react";
if (typeof window !== "undefined") {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
- api_host: "/_proxy/ingest",
+ api_host: "/_posthog/ingest",
ui_host: "https://us.posthog.com",
person_profiles: "identified_only",
capture_pageview: false, // Disable automatic pageview capture, as we capture manually
diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts
index 19dfee7c7d..026aa3a1d3 100644
--- a/apps/web/middleware.ts
+++ b/apps/web/middleware.ts
@@ -25,9 +25,10 @@ export const config = {
* 3. /_proxy/ (special page for OG tags proxying)
* 4. /_static (inside /public)
* 5. /_vercel (Vercel internals)
- * 6. Static files (e.g. /favicon.ico, /sitemap.xml, /robots.txt, etc.)
+ * 6. /_posthog (PostHog proxy)
+ * 7. Static files (e.g. /favicon.ico, /sitemap.xml, /robots.txt, etc.)
*/
- "/((?!api/|_next/|_proxy/|_static|_vercel|[\\w-]+\\.\\w+).*)",
+ "/((?!api/|_next/|_proxy/|_static|_vercel|_posthog|[\\w-]+\\.\\w+).*)",
],
};
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index f443ab4526..03649b4956 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -215,11 +215,11 @@ module.exports = withAxiom({
return [
// for posthog proxy
{
- source: "/_proxy/ingest/static/:path*",
+ source: "/_posthog/ingest/static/:path*",
destination: "https://us-assets.i.posthog.com/static/:path*",
},
{
- source: "/_proxy/ingest/:path*",
+ source: "/_posthog/ingest/:path*",
destination: "https://us.i.posthog.com/:path*",
},
];