File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,22 @@ const config = {
1111 experimental : {
1212 globalNotFound : true ,
1313 } ,
14+ // docs.prisma.io: proxy all requests to prisma.io/docs/... (browser stays on docs.prisma.io).
15+ // Only enable when this deployment is the subdomain proxy; leave unset when this app is used as DOCS_ORIGIN (e.g. *.vercel.app) to avoid a loop.
16+ // For local testing: ENABLE_DOCS_SUBDOMAIN_PROXY=1 and DOCS_PROXY_TARGET=http://localhost:<WEBSITE_PORT>/docs (website must be running on that port)
17+ async rewrites ( ) {
18+ if ( process . env . ENABLE_DOCS_SUBDOMAIN_PROXY !== "1" ) {
19+ return [ ] ;
20+ }
21+ const base =
22+ process . env . DOCS_PROXY_TARGET ?? "https://prisma.io/docs" ;
23+ return [
24+ {
25+ source : "/:path*" ,
26+ destination : `${ base . replace ( / \/ $ / , "" ) } /:path*` ,
27+ } ,
28+ ] ;
29+ } ,
1430} ;
1531
1632export default withSentryConfig ( withMDX ( config ) , {
You can’t perform that action at this time.
0 commit comments