This page is also available as Markdown at /docs/13/pages/api-reference/next-config-js/httpAgentOptions.md. For an index of Next.js 13 Pages Router documentation, see /docs/13/pages/llms.txt.
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?