cmux/web/next.config.ts
Lawrence Chen 93d2245a97
fix(web): exclude PostHog proxy from i18n middleware (#1626)
* fix(web): exclude PostHog proxy path from i18n middleware

The next-intl middleware added in cf75da8f intercepts /cmuxterm/* requests
(the PostHog reverse proxy), causing analytics to break since March 12.
Add cmuxterm to the negative lookahead so proxy requests bypass i18n.

* refactor(web): rename middleware.ts to proxy.ts for Next.js 16

Next.js 16 renamed middleware.ts to proxy.ts. Migrate to the new
convention since we're on Next.js 16.1.6.

* feat(web): migrate PostHog to managed reverse proxy at r.cmux.dev

Replace the Next.js rewrites-based proxy (/cmuxterm -> us.i.posthog.com)
with PostHog's managed reverse proxy at r.cmux.dev. This removes the
rewrites from next.config.ts entirely and eliminates the proxy.ts
matcher conflict that caused the analytics regression.

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-17 17:02:42 -07:00

20 lines
442 B
TypeScript

import "./app/env";
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
const withNextIntl = createNextIntlPlugin("./i18n/request.ts");
const nextConfig: NextConfig = {
skipTrailingSlashRedirect: true,
images: {
remotePatterns: [
{
protocol: "https",
hostname: "github.com",
pathname: "/*.png",
},
],
},
};
export default withNextIntl(nextConfig);