Skip to content

fix(nx-dev): move redirects from Next.js config to Netlify _redirects#34612

Merged
jaysoo merged 1 commit intomasterfrom
DOC-415
Feb 25, 2026
Merged

fix(nx-dev): move redirects from Next.js config to Netlify _redirects#34612
jaysoo merged 1 commit intomasterfrom
DOC-415

Conversation

@jaysoo
Copy link
Member

@jaysoo jaysoo commented Feb 25, 2026

Current Behavior

All 1,200+ redirect rules are processed by the Next.js serverless function via the redirects() config in next.config.js. Every redirect request requires a cold start of the serverless function, which contributed to the 10-minute outage reported in DOC-415.

Expected Behavior

Redirects are handled at the Netlify CDN edge via a plain _redirects file, which is faster and doesn't depend on the Next.js serverless function being healthy.

  • Converted all redirect rules from redirect-rules.js and redirect-rules-docs-to-astro.js into Netlify _redirects format (1,231 rules)
  • Expanded Next.js regex group patterns (e.g. /(l|latest)/...) into individual Netlify rules since Netlify doesn't support regex
  • Converted :path* wildcards to Netlify */:splat syntax
  • Rewrites (Astro docs proxy) remain in next.config.js as they require server-side processing
  • Original JS redirect files kept for reference (can be removed in follow-up)

Related Issue(s)

Fixes DOC-415

@jaysoo jaysoo requested a review from a team as a code owner February 25, 2026 18:28
@jaysoo jaysoo requested a review from MaxKless February 25, 2026 18:28
@nx-cloud
Copy link
Contributor

nx-cloud bot commented Feb 25, 2026

View your CI Pipeline Execution ↗ for commit 497b4bc

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 7m 39s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3m 22s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 8s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-25 19:30:17 UTC

@netlify
Copy link

netlify bot commented Feb 25, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 497b4bc
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/699f44f037c5250008f1c49e
😎 Deploy Preview https://deploy-preview-34612--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 25, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 497b4bc
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/699f44f00b9a78000953d3a0
😎 Deploy Preview https://deploy-preview-34612--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

## Current Behavior
All 1200+ redirect rules are processed by the Next.js serverless function
via the `redirects()` config. This means every redirect request requires a
cold start of the serverless function, contributing to outages.

## Expected Behavior
Redirects are handled at the Netlify CDN edge via a plain `_redirects`
file, which is faster and doesn't depend on the Next.js serverless
function being healthy. Rewrites (Astro docs proxy) remain in
next.config.js as they require server-side processing.

## Related Issue(s)
Fixes DOC-415
@jaysoo jaysoo enabled auto-merge (squash) February 25, 2026 20:48
@jaysoo jaysoo disabled auto-merge February 25, 2026 20:49
@jaysoo jaysoo merged commit 4c3812f into master Feb 25, 2026
28 of 30 checks passed
@jaysoo jaysoo deleted the DOC-415 branch February 25, 2026 20:49
FrozenPandaz pushed a commit that referenced this pull request Feb 26, 2026
…#34612)

## Current Behavior

All 1,200+ redirect rules are processed by the Next.js serverless
function via the `redirects()` config in `next.config.js`. Every
redirect request requires a cold start of the serverless function, which
contributed to the 10-minute outage reported in DOC-415.

## Expected Behavior

Redirects are handled at the Netlify CDN edge via a plain `_redirects`
file, which is faster and doesn't depend on the Next.js serverless
function being healthy.

- Converted all redirect rules from `redirect-rules.js` and
`redirect-rules-docs-to-astro.js` into Netlify `_redirects` format
(1,231 rules)
- Expanded Next.js regex group patterns (e.g. `/(l|latest)/...`) into
individual Netlify rules since Netlify doesn't support regex
- Converted `:path*` wildcards to Netlify `*`/`:splat` syntax
- Rewrites (Astro docs proxy) remain in `next.config.js` as they require
server-side processing
- Original JS redirect files kept for reference (can be removed in
follow-up)

## Related Issue(s)

Fixes DOC-415

(cherry picked from commit 4c3812f)
FrozenPandaz pushed a commit that referenced this pull request Feb 26, 2026
…#34612)

## Current Behavior

All 1,200+ redirect rules are processed by the Next.js serverless
function via the `redirects()` config in `next.config.js`. Every
redirect request requires a cold start of the serverless function, which
contributed to the 10-minute outage reported in DOC-415.

## Expected Behavior

Redirects are handled at the Netlify CDN edge via a plain `_redirects`
file, which is faster and doesn't depend on the Next.js serverless
function being healthy.

- Converted all redirect rules from `redirect-rules.js` and
`redirect-rules-docs-to-astro.js` into Netlify `_redirects` format
(1,231 rules)
- Expanded Next.js regex group patterns (e.g. `/(l|latest)/...`) into
individual Netlify rules since Netlify doesn't support regex
- Converted `:path*` wildcards to Netlify `*`/`:splat` syntax
- Rewrites (Astro docs proxy) remain in `next.config.js` as they require
server-side processing
- Original JS redirect files kept for reference (can be removed in
follow-up)

## Related Issue(s)

Fixes DOC-415

(cherry picked from commit 4c3812f)
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants