Part 14 / Topic 6 of 6
Where Proxy sits in the pipeline, and the Server Actions edge case
The installed proxy.md reference lists Next.js's own documented execution order:
headersfromnext.config.jsredirectsfromnext.config.js- Proxy (
rewrites,redirects, etc.) beforeFilesrewrites fromnext.config.js- Filesystem routes (
public/,pages/,app/, ...) afterFilesrewrites- Dynamic routes
fallbackrewrites
Proxy runs third — after next.config.js's own static headers/redirects, but before a single file in app/ is even looked at. The docs add one sharp, non-obvious warning worth carrying into Part 15 before writing any auth proxy: "Server Functions are not separate routes in this chain. They are handled as POST requests to the route where they are used, so a Proxy matcher that excludes a path will also skip Server Function calls on that path... A matcher change or a refactor that moves a Server Function to a different route can silently remove Proxy coverage." Part 12's swiggy-menu Server Actions live entirely outside this part's /status matcher, so they're unaffected here — but the moment a proxy is asked to do anything security-relevant (Part 15's whole subject), this is the exact trap: a matcher that looks like it covers "the app" can quietly stop covering a Server Action that moved routes, with no error anywhere to say so.
Done here? The practice set for Part 14 — including the solutions — is on the part page.