fix(marketing): stop the locale proxy from swallowing /ingest, /monitoring and /md
What broke
#7002 (localized URLs) added apps/marketing/src/proxy.ts. Its matcher skipped _next, api, and anything containing a dot — so every extensionless non-page path was rewritten to /en/... and 404'd.
Merged 2026-08-29 21:46 UTC. Marketing events stop at 21:49:59 UTC.
| Path | Consequence |
|---|---|
/ingest/* | All PostHog capture from superset.sh — pageviews, download_clicked, download_started, waitlist |
/monitoring | Sentry's tunnelRoute — marketing error reporting equally dark |
/md/<section>/<slug> | Markdown twins for agents returned an HTML 404 instead of the recoverable markdown 404 the route exists to serve |
Verified against production:
POST superset.sh/ingest/i/v0/e/ -> 404 x-matched-path: /404
POST superset.sh/monitoring -> 404 x-matched-path: /[lang]/[slug]
GET superset.sh/md/page/pricing -> 404 x-matched-path: /404 (content-type: text/html)
GET superset.sh/ingest/static/array.js -> 200
Why nobody noticed for four days. /ingest/static/*.js has a dot, so it slipped through the matcher — posthog-js kept loading and initializing normally, then every capture request died. Nothing throws, nothing 500s, the pages all return 200. It surfaced only because a dashboard funnel read 0%.
Scope
Marketing only. apps/web and apps/api already exclude both paths:
"/((?!_next|ingest|monitoring|[^?]*\\.(?:html?|css|…)).*)"
admin and docs have no proxy. Desktop and mobile point straight at PostHog (NEXT_PUBLIC_POSTHOG_HOST / EXPO_PUBLIC_POSTHOG_HOST), no Next routing in the path. All confirmed still reporting throughout the outage.
Marketing's matcher was written fresh for #7002 rather than copying the established one, which is how ingest and monitoring got dropped.
Changes
proxy.tsmatcher namesingestandmonitoringexplicitly, with a comment on why the dot heuristic is not enough./mdmoves under[lang]instead of being exempted — the rewrite is then what makes it work. Bonus: the twins are now localized./ja/md/page/pricingserves Japanese markdown, which it never did. The route seeds i18n viainitServerI18n()like every other[lang]entry, and canonicals carry the locale prefix.- Deploy gate gets a second non-localized pass over the non-page endpoints. The gate already fails on 4xx — it just listed only pages, so it stayed green through the whole outage.
Not fixed here
.well-known/* survives only because .well-known contains a dot. It works, but it is luck rather than intent.
Aug 29 → now analytics and Sentry data is unrecoverable.
https://claude.ai/code/session_01SduXRDYRusSKRKs6sFg31t
Summary by cubic
Fixes the marketing locale proxy so extensionless service routes and markdown twins are no longer sent into the wrong page tree. This restores PostHog capture and Sentry reporting and makes markdown twins serve the requested locale.
- Excludes
ingestandmonitoringfrom locale rewriting. - Reads the markdown route's locale from its own
[lang]params, seeds route-handler i18n, and updates localized canonical and URL fields. - Adds deploy-preview smoke tests for markdown, text, robots, sitemap, and MCP endpoints.
Summary by CodeRabbit
-
Bug Fixes
- Fixed localized markdown pages so canonical URLs correctly include the locale for non-English versions.
- Unsupported locales for localized markdown pages now return a not-found response.
- Prevented analytics and monitoring endpoints from being incorrectly rewritten as localized routes.
- Corrected handling for marketing metadata, text, and service endpoints, including robots.txt, sitemap.xml, and well-known routes.
-
Tests
- Added deployment smoke tests covering marketing markdown, text, metadata, and service endpoints.