文档中心Next.jshttpAgentOptions 在 Node.js 18 之前的版本中,Next.js 会自动使用 undici 对 fetch() 进行 polyfill,并默认启用 HTTP Keep-Alive。 要在服务器端禁用所有 fetch() 调用的 HTTP Keep-Alive,请打开 next.config.js 并添加 httpAgentOptions 配置: Copyjavascriptmodule.exports = { httpAgentOptions: { keepAlive: false, }, }