This page is also available as Markdown: request this page's URL with an
Accept: text/markdown header. For an index of Next.js 14 Pages Router documentation, see /docs/14/pages/llms.txt.You are currently viewing the Pages Router documentation for version 14 of Next.js.
httpAgentOptions
Last updated June 28, 2023
In Node.js versions prior to 18, Next.js automatically polyfills fetch() with undici and enables HTTP Keep-Alive by default.
To disable HTTP Keep-Alive for all fetch() calls on the server-side, open next.config.js and add the httpAgentOptions config:
next.config.js
module.exports = {
httpAgentOptions: {
keepAlive: false,
},
}Was this helpful?