株式会社オブライト
Web Frontend2026-05-17

Middleware

Also known as: Middleware / ミドルウェア / Next.js Middleware

A processing layer between HTTP requests and responses. In Next.js (v15: middleware.ts, v16+: proxy.ts), it handles routing control, auth checks, and geo-redirects on the Edge Runtime.


Overview

Next.js Middleware runs before requests reach route handlers. Common uses include auth token validation, i18n redirects, A/B testing, and rate limiting. In Next.js 16, middleware.ts is deprecated and must be renamed to proxy.ts.

Matcher Configuration

Scoping Middleware execution with the matcher setting optimizes performance. The recommended pattern is '/((?!api|trpc|_next|_vercel|.*\\..*).*)'. See Vercel + Next.js 16 complete guide for details.

Related Columns

Related Terms

Feel free to contact us

Contact Us