Proxy (formerly Middleware) before the request
Answer: Proxy (renamed from Middleware in Next.js 16) runs code before a request completes. Use matcher to limit which paths it runs on.
See also
Claims
- id: C1 claim: Middleware was renamed to Proxy. source: S1 evidence: "Middleware is now called Proxy to better reflect its purpose."
- id: C2 claim: Proxy runs before a request completes. source: S1 evidence: "Proxy allows you to run code before a request is completed."
- id: C3 claim: middleware file convention renamed to proxy. source: S2 evidence: "
middlewarefile convention is deprecated and has been renamed to"
- id: C4 claim: Matcher targets specific Proxy paths. source: S2 evidence: "The
matcheroption allows you to target specific paths for the Proxy to run on."
Sources
- [S1] Proxy. Next.js docs. https://nextjs.org/docs/app/getting-started/proxy . License: MIT (vercel/next.js). Accessed 2026-11-09.
- [S2] proxy.js. Next.js docs. https://nextjs.org/docs/app/api-reference/file-conventions/proxy . License: MIT (vercel/next.js). Accessed 2026-11-09.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Copyright (c) 2025 Vercel, Inc. Sources: Next.js docs (vercel/next.js on GitHub / nextjs.org), MIT (https://raw.githubusercontent.com/vercel/next.js/canary/license.md). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Next.js docs, Proxy, MIT (vercel/next.js); Next.js docs, proxy.js, MIT (vercel/next.js). Copyright (c) 2025 Vercel, Inc. MIT (https://raw.githubusercontent.com/vercel/next.js/canary/license.md).
Cite this
iinventedlight. 2026. "Proxy (formerly Middleware) before the request." iinventedlight Library, iil:note:3ttqfa8x, version of 2026-11-09. https://iinventedlight.com/library/notes/nextjs-proxy/. License: CC-BY-4.0.
@misc{iil_note_3ttqfa8x,
author = {{iinventedlight}},
title = {{Proxy (formerly Middleware) before the request}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-09},
url = {https://iinventedlight.com/library/notes/nextjs-proxy/},
note = {Permanent ID iil:note:3ttqfa8x. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/nextjs-proxy.md.