Skip to content

fix(analytics): use greedy regex in PostHog ingest rewrites#481

Merged
koala73 merged 1 commit into
mainfrom
fix/posthog-ingest-rewrite
Feb 27, 2026
Merged

fix(analytics): use greedy regex in PostHog ingest rewrites#481
koala73 merged 1 commit into
mainfrom
fix/posthog-ingest-rewrite

Conversation

@koala73

@koala73 koala73 commented Feb 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix PostHog /ingest/* 404 errors by switching Vercel rewrite patterns from :path* to :path(.*)
  • Vercel's :path* wildcard silently fails on trailing slashes that PostHog SDK appends (e.g. /ingest/s/?compression=...)
  • Known Vercel issue: Vercel reverse proxy not working PostHog/posthog#17596

Test plan

  • Deploy to preview, confirm PostHog events reach us.i.posthog.com (no 404s in browser console)
  • Verify /ingest/static/* assets still load (PostHog JS bundle)
  • Check PostHog dashboard for incoming events after deploy

Vercel's :path* wildcard doesn't match trailing slashes that
PostHog SDK appends (e.g. /ingest/s/?compression=...), causing 404s.
Switch to :path(.*) which matches all path segments including
trailing slashes. Ref: PostHog/posthog#17596
@vercel

vercel Bot commented Feb 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Building Building Preview, Comment Feb 27, 2026 7:11pm
worldmonitor-finance Building Building Preview, Comment Feb 27, 2026 7:11pm
worldmonitor-happy Building Building Preview, Comment Feb 27, 2026 7:11pm
worldmonitor-startup Building Building Preview, Comment Feb 27, 2026 7:11pm

Request Review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@koala73
koala73 merged commit 0e10195 into main Feb 27, 2026
6 checks passed
@koala73
koala73 deleted the fix/posthog-ingest-rewrite branch February 27, 2026 20:51
koala73 added a commit that referenced this pull request Mar 1, 2026
Vercel's :path* wildcard doesn't match trailing slashes that
PostHog SDK appends (e.g. /ingest/s/?compression=...), causing 404s.
Switch to :path(.*) which matches all path segments including
trailing slashes. Ref: PostHog/posthog#17596
koala73 added a commit that referenced this pull request Mar 1, 2026