Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs/01-app/01-getting-started/16-proxy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/01-app/02-guides/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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](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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> - 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)
> - Proxy uses the Node.js runtime, check if your Auth library and session management library are compatible. You may need to use [Proxy](/docs/app/api-reference/file-conventions/proxy) if your Auth library only supports [Edge Runtime](/docs/app/api-reference/edge)

Line 1124 contains a broken GitHub link to deprecated middleware documentation. The link should reference the internal documentation for Proxy instead: /docs/app/api-reference/file-conventions/proxy.

View Details

Analysis

Broken documentation link in authentication guide

What fails: Line 1124 in docs/01-app/02-guides/authentication.mdx contains an incorrect documentation link pointing to a GitHub URL for deprecated middleware documentation.

How to reproduce:

  • Open docs/01-app/02-guides/authentication.mdx
  • Navigate to line 1124
  • The link text reads [Middleware](https://github.com/vercel/next.js/blob/v15.5.6/docs/01-app/03-api-reference/03-file-conventions/middleware.mdx)

What happened vs expected behavior:

  • The link pointed to a GitHub blob URL targeting a non-existent middleware.mdx file (deprecated in favor of proxy)
  • Expected: Link should point to the internal documentation path /docs/app/api-reference/file-conventions/proxy and display [Proxy] as the link text
  • The pattern matches existing correct usage at line 1026 in the same file

Fix applied: Changed line 1124 from:

[Middleware](https://github.com/vercel/next.js/blob/v15.5.6/docs/01-app/03-api-reference/03-file-conventions/middleware.mdx)

to:

[Proxy](/docs/app/api-reference/file-conventions/proxy)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the time being, I reckon we need to link to some documentation about Middleware for those who are using Edge runtime.

> - 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.
<AppOnly>
Expand Down
13 changes: 12 additions & 1 deletion docs/01-app/03-api-reference/03-file-conventions/proxy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Loading