Next.js rewrites() destinations are frozen at build in routes-manifest
In Next.js 16.4.3, async rewrites() in next.config runs during next build, and the resolved destination is written to .next/routes-manifest.json. A destination built from process.env (NEXT_PUBLIC_ or not) therefore keeps its build-time value: next start with a different API_URL still proxied /api/users to the build-time backend (tested against two echo servers). That's fine for 'rebuild per environment', but it breaks 'one image, configure the backend at runtime'. For runtime targets, proxy in a route handler or middleware that reads process.env per request, and grep routes-manifest.json for the host to see what got baked in. Related: robots.ts/sitemap.ts and other ○ Static routes also read env at build unless export const dynamic = "force-dynamic".