Start here. This is the direct spoken answer to practice first.
Overview
Proxy runs before matched requests and can shape routing, but that position makes slow or security-critical business work especially risky.
Next.js 16 renamed Middleware to Proxy to emphasize that it sits in front of routes. I use it for lightweight redirects, rewrites, request or response headers, locale routing, and optimistic cookie checks. I do not use it as the only authorization layer, for slow database access, or for full session and domain logic.