Skip to content

docs: clarify that proxy/middleware matches static assets by default#92441

Merged
icyJoseph merged 6 commits into
canaryfrom
cursor/default-middleware-asset-matching-a9e8
Apr 7, 2026
Merged

docs: clarify that proxy/middleware matches static assets by default#92441
icyJoseph merged 6 commits into
canaryfrom
cursor/default-middleware-asset-matching-a9e8

Conversation

@icyJoseph

@icyJoseph icyJoseph commented Apr 7, 2026

Copy link
Copy Markdown
Member

What?

Adds an explicit note about Proxy's default matching behavior at the top of the Matcher section in the Proxy API reference — the first place users look when configuring which paths Proxy runs on.

Why?

Users have reported issues where Tailwind styles and other static assets fail to load because their Proxy auth logic intercepts _next/static requests and redirects them (see #92435). The existing docs mention that Proxy runs on "every route" but don't explicitly call out static assets, image optimizations, or public folder files — making this a common pitfall that gets misdiagnosed as a CSS/PostCSS problem.

How?

Added an inline paragraph at the top of the Matcher subsection explaining that without a matcher, Proxy matches every request — including _next/static, _next/image, and public/ files — and that this can break asset loading. Links to the existing Negative matching section.

Fixes #92435

Slack Thread

Open in Web Open in Cursor 

…fault

Add a 'Good to know' callout in the Execution order section explaining
that without a configured matcher, Proxy runs on every request including
_next/static, _next/image, and public/ files. This helps users avoid
silently breaking CSS/JS loading when implementing auth logic in Proxy.

Fixes #92435

Co-authored-by: Joseph <icyJoseph@users.noreply.github.com>
@nextjs-bot nextjs-bot added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. labels Apr 7, 2026
…lity

The previous callout was in the Execution order section, which is far
down the page. Users setting up Proxy will read the Matcher section
first, so add the static asset warning there too — right at the top of
the section where it explains what matcher does.

Co-authored-by: Joseph <icyJoseph@users.noreply.github.com>
@nextjs-bot

Copy link
Copy Markdown
Contributor

Allow CI Workflow Run

  • approve CI run for commit: 566791c

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@nextjs-bot

nextjs-bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Allow CI Workflow Run

  • approve CI run for commit: b430829

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

cursoragent and others added 3 commits April 7, 2026 09:33
Keep the warning only in the Matcher section where it belongs.

Co-authored-by: Joseph <icyJoseph@users.noreply.github.com>
Co-authored-by: Joseph <icyJoseph@users.noreply.github.com>
Co-authored-by: Joseph <icyJoseph@users.noreply.github.com>
@icyJoseph icyJoseph marked this pull request as ready for review April 7, 2026 09:57
@icyJoseph icyJoseph merged commit b9a1476 into canary Apr 7, 2026
74 checks passed
@icyJoseph icyJoseph deleted the cursor/default-middleware-asset-matching-a9e8 branch April 7, 2026 10:07
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. locked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Tailwind styles not loading when Next.js middleware blocks _next/static routes

4 participants