Hi All,
we are using rewrites
to proxy requests to external domains. While this works functionally, the static assets (e.g., JavaScript chunks, images, etc.) required for the rewritten destination are not being loaded correctly unless the domain is explicitly set using the assetPrefix
configuration in next.config.js
.
Next.js only allows a single string value for assetPrefix
, and does not support an array of domains. This becomes a limitation when we want to proxy to multiple domains, as we cannot define multiple asset prefixes to support all the rewritten destinations.
As a result, asset loading fails for rewritten routes that do not match the single domain defined in assetPrefix
.
any help is appreciated !