Skip to content

Commit 1a90e05

Browse files
authored
Update multi-zones.mdx
To serve the static content from the right application you also need a rewrite rule for the static assets and not only the actual content.
1 parent 37d372b commit 1a90e05

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/01-app/02-guides/multi-zones.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const nextConfig = {
7373

7474
With the Multi Zones set-up, you need to route the paths to the correct zone since they are served by different applications. You can use any HTTP proxy to do this, but one of the Next.js applications can also be used to route requests for the entire domain.
7575

76-
To route to the correct zone using a Next.js application, you can use [`rewrites`](/docs/app/api-reference/config/next-config-js/rewrites). For each path served by a different zone, you would add a rewrite rule to send that path to the domain of the other zone. For example:
76+
To route to the correct zone using a Next.js application, you can use [`rewrites`](/docs/app/api-reference/config/next-config-js/rewrites). For each path served by a different zone, you would add a rewrite rule to send that path to the domain of the other zone, and you also need to rewrite the requests for the static assets. For example:
7777

7878
```js filename="next.config.js"
7979
async rewrites() {
@@ -85,6 +85,10 @@ async rewrites() {
8585
{
8686
source: '/blog/:path+',
8787
destination: `${process.env.BLOG_DOMAIN}/blog/:path+`,
88+
},
89+
{
90+
source: '/blog-static/:path+',
91+
destination: `${process.env.BLOG_DOMAIN}/blog-static/:path+`,
8892
}
8993
];
9094
}

0 commit comments

Comments
 (0)