【发布时间】:2021-01-28 12:07:03
【问题描述】:
我在开发中发现了对代理到我的后端服务器的重写:
https://nextjs.org/docs/api-reference/next.config.js/rewrites
rewrites: async () => [
...nextI18NextRewrites(localeSubpaths),
{ source: '/api/:path*', destination: 'http://localhost:8080/:path*' },
],
如果 url 不是 localhost,这在生产中如何工作?
对于目的地,我需要添加完整域还是需要单独的重写规则用于开发/生产?
【问题讨论】:
标签: javascript proxy url-rewriting next.js