iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🔋
Removing the x-powered-by header in a Next.js custom server
I struggled with how to disable x-powered-by in Next.js, so I'm writing this down for the record.
- Disabling it on the Express side doesn't work!
- Even with
express().disable('x-powered-by'), it gets overwritten by Next.
- Even with
- Set it in
next.config.js!
module.exports = {
poweredByHeader: false,
};
Official Doc
Discussion