CONTACT US

Next.js Deprecates Middleware for Proxy

Bold text reads Next.js deprecates middleware for proxy on a dark background with abstract outlines of screens and rectangles.

 

In a recent pull request, the Next.js team announced that the middleware convention is being deprecated and replaced with proxy. Instead of middleware.ts, the team recommends using proxy.ts.

If your project lives under src/, then src/middleware.ts becomes src/proxy.ts.  The logic for redirects, rewrites, or auth checks will continue to work the same way, so why the rename?

Developers often used middleware.ts for authentication, redirects, and rewrites, but the term middleware implied an open-ended pipeline of chained functions, which isn’t how Next.js edge logic works.

The term proxy, helps clarify that this feature is about intercepting and reshaping requests/responses at the edge, not building a middleware chain

Read the official PR on Next.js GitHub.

Need help with your Next.js app? Contact us.

Subscribe to Frictionless, the weekly newsletter by our CEO, Chris Lojniewski, and stay on top of the news.

Article link copied

Close button