Skip to content

fix: properly redirect#7500

Merged
mhartington merged 7 commits intomainfrom
fix/proxy
Feb 16, 2026
Merged

fix: properly redirect#7500
mhartington merged 7 commits intomainfrom
fix/proxy

Conversation

@mhartington
Copy link
Member

@mhartington mhartington commented Feb 16, 2026

Summary by CodeRabbit

  • New Features

    • Documentation is served under a /docs base path in production.
    • Production now redirects all doc paths to the main docs site (non-permanent); in non-production, no redirects are added.
  • Chores

    • Configuration and formatting normalization (quotes, spacing) and small Sentry config string updates.

@vercel
Copy link

vercel bot commented Feb 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 16, 2026 6:15pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉


Walkthrough

Adds basePath: '/docs' and an exported async redirects() to apps/docs/next.config.mjs; redirects() returns [] when ENABLE_DOCS_SUBDOMAIN_PROXY === '1', otherwise returns a non-permanent redirect from /:path*https://prisma.io/docs/:path*. Normalizes several string literals to single quotes.

Changes

Cohort / File(s) Summary
Next.js config & routing
apps/docs/next.config.mjs
Adds basePath: '/docs'; introduces exported async redirects() returning [] when ENABLE_DOCS_SUBDOMAIN_PROXY === '1', otherwise a non-permanent redirect { source: '/:path*', destination: 'https://prisma.io/docs/:path*', permanent: false }; adjusts production proxy logic to target prisma.io/docs; normalizes quoting to single quotes (e.g., transpilePackages, Sentry org, project, tunnelRoute) and minor formatting changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: properly redirect' is vague and doesn't clearly specify what is being redirected or the primary change being made. Consider a more specific title such as 'fix: redirect docs to prisma.io/docs' or 'fix: replace rewrites with redirects in docs config' to better convey the actual change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 16, 2026

🍈 Lychee Link Check Report

3660 links: ✅ 2986 OK | 🚫 8 errors | 🔀 0 redirects | 👻 664 excluded

❌ Errors

./apps/docs/content/docs.v6/(index)/prisma-orm/add-to-existing-project/mongodb.mdx

./apps/docs/content/docs.v6/(index)/prisma-orm/quickstart/mongodb.mdx

./apps/docs/content/docs.v6/orm/more/dev-environment/editor-setup.mdx

  • [503] https://fig.io/ | Rejected status code (this depends on your "accept" configuration): Service Unavailable

./apps/docs/content/docs.v6/orm/prisma-client/setup-and-configuration/databases-connections/index.mdx

./apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/mongodb.mdx

./apps/docs/content/docs/(index)/prisma-orm/quickstart/mongodb.mdx

./apps/docs/content/docs/orm/more/dev-environment/editor-setup.mdx

  • [503] https://fig.io/ | Rejected status code (this depends on your "accept" configuration): Service Unavailable

./apps/docs/content/docs/postgres/integrations/raycast.mdx


Full Statistics Table
Status Count
✅ Successful 2986
🔀 Redirected 0
👻 Excluded 664
🚫 Errors 8
⛔ Unsupported 2
⏳ Timeouts 0
❓ Unknown 0

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/docs/next.config.mjs`:
- Around line 29-37: The redirects() implementation currently defines an
unconditional catch-all redirect that makes the app unreachable and can cause
cached 308 redirects; update the redirects() function to only return this
redirect when the intended guard is set (e.g., check the same
ENABLE_DOCS_SUBDOMAIN_PROXY or DOCS_ORIGIN env var used by rewrites()), ensure
the redirect and the rewrites() proxy behavior are mutually exclusive (only one
path is active at a time), and change permanent: true to permanent: false (use
307) while validating to avoid hard-caching by browsers; adjust logic inside
redirects() to consult process.env and mirror the conditional used in rewrites()
so the redirect won’t run unguarded.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@apps/docs/next.config.mjs`:
- Around line 8-9: The current config sets basePath and assetPrefix (basePath:
'/docs', assetPrefix: 'https://docs.prisma.io') which will conflict with the
unconditional redirect in redirects() (the redirect that sends all traffic from
docs.prisma.io to prisma.io/docs) — asset requests will be redirected and
bundles won't load; either remove or adjust assetPrefix to point to the actual
static host where the app is served (e.g., the Vercel/prisma.io origin), or make
the redirect conditional so the app can serve assets at docs.prisma.io; update
next.config.mjs to ensure assetPrefix matches the real bundle host or remove the
unconditional redirect in redirects() so basePath and assetPrefix are consistent
with your intended deployment topology.
- Line 9: The current static basePath: '/docs' causes the app to only handle
/docs/* paths and breaks the subdomain proxy scenario; make basePath conditional
the same way rewrites() is gated. Update next.config.mjs to compute basePath
based on the same environment/flag used for rewrites() (e.g., an IS_ORIGIN_PROXY
or ENABLE_ORIGIN_PROXY env var) so that when the subdomain proxy mode is active
the config uses basePath: '' (or omits basePath) and when the origin deployment
is used it sets basePath: '/docs'; reference the existing basePath setting and
the rewrites() gating logic in next.config.mjs to implement the conditional.

/** @type {import('next').NextConfig} */
const config = {
assetPrefix: 'https://docs.prisma.io',
basePath: '/docs', // if serving under /docs path
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

basePath: '/docs' breaks the subdomain proxy use case described in lines 16–18.

The comments on lines 16–18 describe a deployment mode where docs.prisma.io proxies all requests through this app via rewrites(). With basePath: '/docs', this app only handles requests under the /docs path prefix. That means:

  • docs.prisma.io/getting-started404 (no /docs prefix, app won't handle it)
  • docs.prisma.io/docs/getting-started → matches, but that's not the desired URL structure for the subdomain

The subdomain proxy scenario assumes the app serves at /, not /docs. If basePath is needed for the prisma.io/docs deployment (where the website proxies /docs/* to this origin), you'll need to make basePath conditional — similar to how rewrites() is gated:

Sketch: conditional basePath
 const config = {
-  assetPrefix: 'https://docs.prisma.io',
-  basePath: '/docs',
+  ...(process.env.ENABLE_DOCS_SUBDOMAIN_PROXY === '1'
+    ? {}
+    : { basePath: '/docs', assetPrefix: 'https://docs.prisma.io' }),

This way the subdomain deployment serves at / and the origin deployment serves at /docs.

🤖 Prompt for AI Agents
In `@apps/docs/next.config.mjs` at line 9, The current static basePath: '/docs'
causes the app to only handle /docs/* paths and breaks the subdomain proxy
scenario; make basePath conditional the same way rewrites() is gated. Update
next.config.mjs to compute basePath based on the same environment/flag used for
rewrites() (e.g., an IS_ORIGIN_PROXY or ENABLE_ORIGIN_PROXY env var) so that
when the subdomain proxy mode is active the config uses basePath: '' (or omits
basePath) and when the origin deployment is used it sets basePath: '/docs';
reference the existing basePath setting and the rewrites() gating logic in
next.config.mjs to implement the conditional.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@mhartington mhartington merged commit 6b4a534 into main Feb 16, 2026
6 of 10 checks passed
@mhartington mhartington deleted the fix/proxy branch February 16, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant