From dfdf06624b0500ef2fe549db117959e68ac4f625 Mon Sep 17 00:00:00 2001 From: Joseph Chamochumbi Date: Sat, 25 Oct 2025 12:13:58 +0200 Subject: [PATCH 1/3] docs: fix proxy matcher overflow --- .../03-api-reference/03-file-conventions/proxy.mdx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx index 391b7f971943e..cbaf5bd182b2f 100644 --- a/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx +++ b/docs/01-app/03-api-reference/03-file-conventions/proxy.mdx @@ -80,7 +80,18 @@ export const config = { } ``` -Additionally, the `matcher` option supports complex path specifications through regular expressions, such as `matcher: ['/((?!api|_next/static|_next/image|.*\\.png$).*)']`, enabling precise control over which paths to include or exclude. +Additionally, the `matcher` option supports complex path specifications using regular expressions. For example, you can exclude certain paths with a regular expression matcher: + +```js filename="proxy.js" +export const config = { + matcher: [ + // Exclude API routes, static files, image optimizations, and .png files + '/((?!api|_next/static|_next/image|.*\\.png$).*)', + ], +} +``` + +This enables precise control over which paths to include or exclude. The `matcher` option accepts an array of objects with the following keys: From 8e970ea1f373e80c718ef817145c457ce9428e35 Mon Sep 17 00:00:00 2001 From: Joseph Chamochumbi Date: Sat, 25 Oct 2025 20:14:27 +0200 Subject: [PATCH 2/3] docs: proxy feedback 2 --- docs/01-app/01-getting-started/16-proxy.mdx | 5 +---- docs/01-app/02-guides/authentication.mdx | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/01-app/01-getting-started/16-proxy.mdx b/docs/01-app/01-getting-started/16-proxy.mdx index 66c912345a753..074680bcb00d6 100644 --- a/docs/01-app/01-getting-started/16-proxy.mdx +++ b/docs/01-app/01-getting-started/16-proxy.mdx @@ -22,10 +22,7 @@ Some common scenarios where Proxy is effective include: - Rewriting to different pages based on A/B tests or experiments - Modifying headers for all pages or a subset of pages -Proxy is _not_ a good fit for: - -- Slow data fetching -- Session management +Proxy is _not_ intended for slow data fetching. While Proxy can be helpful for [optimistic checks](/docs/app/guides/authentication#optimistic-checks-with-proxy-optional) such as permission-based redirects, it should not be used as a full session management or authorization solution. Using fetch with `options.cache`, `options.next.revalidate`, or `options.next.tags`, has no effect in Proxy. diff --git a/docs/01-app/02-guides/authentication.mdx b/docs/01-app/02-guides/authentication.mdx index d0ee3f52110ec..1eb06e754aaf1 100644 --- a/docs/01-app/02-guides/authentication.mdx +++ b/docs/01-app/02-guides/authentication.mdx @@ -1121,7 +1121,7 @@ While Proxy can be useful for initial checks, it should not be your only line of > **Tips**: > > - In Proxy, you can also read cookies using `req.cookies.get('session').value`. -> - Proxy uses the [Edge Runtime](/docs/app/api-reference/edge), check if your Auth library and session management library are compatible. +> - Proxy uses the Node.js runtime, check if your Auth library and session management library are compatible. You may need to use [Middleware](/docs/15/app/api-reference/file-conventions/middleware) if your Auth library only supports [Edge Runtime](/docs/api-reference/edge) > - You can use the `matcher` property in the Proxy to specify which routes Proxy should run on. Although, for auth, it's recommended Proxy runs on all routes. From 50d6b97f8fe3e98fb5ee96080c0ba5643a2ca5f8 Mon Sep 17 00:00:00 2001 From: Joseph Chamochumbi Date: Mon, 27 Oct 2025 10:05:58 +0100 Subject: [PATCH 3/3] docs: link checker doesn't support older versions --- docs/01-app/02-guides/authentication.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/01-app/02-guides/authentication.mdx b/docs/01-app/02-guides/authentication.mdx index 1eb06e754aaf1..e90dea91b9216 100644 --- a/docs/01-app/02-guides/authentication.mdx +++ b/docs/01-app/02-guides/authentication.mdx @@ -1121,7 +1121,7 @@ While Proxy can be useful for initial checks, it should not be your only line of > **Tips**: > > - In Proxy, you can also read cookies using `req.cookies.get('session').value`. -> - Proxy uses the Node.js runtime, check if your Auth library and session management library are compatible. You may need to use [Middleware](/docs/15/app/api-reference/file-conventions/middleware) if your Auth library only supports [Edge Runtime](/docs/api-reference/edge) +> - Proxy uses the Node.js runtime, check if your Auth library and session management library are compatible. You may need to use [Middleware](https://github.com/vercel/next.js/blob/v15.5.6/docs/01-app/03-api-reference/03-file-conventions/middleware.mdx) if your Auth library only supports [Edge Runtime](/docs/app/api-reference/edge) > - You can use the `matcher` property in the Proxy to specify which routes Proxy should run on. Although, for auth, it's recommended Proxy runs on all routes.