How to Remove the X-Powered-By Header (and the Server Header) in 2026

On November 11, 2026, we sent one request to the homepages of 15 hosting and AI-builder platforms and read the response headers. Vercel's own site answered with x-powered-by: Next.js, Payload. Replit's sent x-powered-by: Express. Fly.io's Server header carried a build hash and a date: Fly/366e4bf88 (2026-10-27).

None of that is a breach. It's a label on the front door saying which lock you bought. If your scan flagged "Backend framework Disclosed: Next.js" or "Server software Disclosed: nginx/1.18.0", this is the fix, one stack at a time.

TL;DR

Most frameworks announce themselves by default. Next.js sends X-Powered-By: Next.js until you set poweredByHeader: false; Express sends X-Powered-By: Express until you call app.disable('x-powered-by'). We tested both on current versions. A Server header that just names your host (Vercel, Netlify, cloudflare) is set by the platform's edge, can't be removed from your app, and isn't worth chasing. A Server header with a version number is.

What the finding actually means

Our scanner reads your homepage's response headers and flags any of these nine: Server, X-Powered-By, X-AspNet-Version, X-AspNetMvc-Version, X-Debug-Token, X-Debug-Token-Link, X-Drupal-Cache, X-Generator and X-Runtime. Each one is rated low severity, and that's honest. An attacker who knows you run Next.js hasn't broken anything yet.

What it changes is speed. Automated scanners sweep the internet for a framework name and version, then try the exploits published for that version. A header that says nginx/1.18.0 saves them the guesswork, and it puts your site on the list the next time a CVE for that version drops. Removing it takes one line of config, so there's no good reason to keep advertising.

X-Debug-Token is the exception, and it isn't low severity in practice. It means Symfony's web profiler is switched on in production. The profiler records the full detail of every request it sees and serves it back at /_profiler. Don't just strip the header: turn the profiler off in your production environment config and redeploy.

Two kinds of header: yours and your host's

Here's what the 15 homepages sent back. We kept only the headers our scanner checks.

SiteWhat it disclosed
vercel.comserver: Vercel, x-powered-by: Next.js, Payload
replit.comserver: cloudflare, x-powered-by: Express
fly.ioserver: Fly/366e4bf88 (2026-10-27)
heroku.comserver: nginx
netlify.comserver: Netlify
supabase.com, nextjs.orgserver: Vercel
cloudflare.com, render.com, lovable.dev, bolt.new, expressjs.comserver: cloudflare
railway.comserver: railway-hikari
rubyonrails.orgserver: GitHub.com
php.netserver: BunnyCDN-PB1-1430

Two different things are going on in that table.

X-Powered-By comes from your app. Your framework adds it, so your config can remove it. Vercel and Replit simply haven't bothered on their marketing sites.

A bare Server header usually comes from your host. On Vercel, Netlify, Cloudflare and Fly, the edge sets Server after your code has already responded. Nothing in next.config.js reaches it, and Cloudflare's Transform Rules docs say outright that you can't modify server. When the value is only a host name, there's no version for anyone to look up, so treat that finding as informational and move on.

The ones worth fixing are a Server header with a version in it (nginx/1.18.0, Apache/2.4.41 (Ubuntu)), which means you run that server yourself, and any X-Powered-By.

Remove it, by stack

1

Next.js: set poweredByHeader to false

next.config.js
module.exports = {
  poweredByHeader: false,
}

We built a blank Next.js 16.4.6 app and ran next start. With an empty config the response carried X-Powered-By: Next.js. With the line above it didn't. If your config is next.config.mjs or next.config.ts, add the same key to the exported object.

2

Express: disable it, or let helmet do it

server.js
const express = require('express')
const app = express()
app.disable('x-powered-by')

Express 5.3.0, the current release, still sends X-Powered-By: Express out of the box; we checked. The line above removes it. If you already have app.use(helmet()), you're covered: helmet 8.3.0 stripped the header in the same test with no extra config.

3

PHP: turn off expose_php

Set expose_php = Off in php.ini and restart PHP-FPM or Apache. That removes the X-Powered-By: PHP/8.x header. It's a php.ini setting, so ini_set() inside your code won't work. On shared hosting where you can't edit php.ini, ask the host, or remove it at the web server with Header unset X-Powered-By (Apache, needs mod_headers).

4

nginx and Apache: drop the version number

For nginx, add server_tokens off; inside the http block. The header drops from nginx/1.18.0 to plain nginx, and error pages stop printing the version too. Removing the header entirely needs the third-party headers-more module (more_clear_headers Server;), which most setups don't need.

For Apache, set ServerTokens Prod and ServerSignature Off. That cuts it to plain Apache.

5

Rails, ASP.NET and the rest

  • Rails X-Runtime: it comes from the Rack::Runtime middleware. Newer Rails versions no longer include it by default, so run bin/rails middleware to see whether yours does. If it's listed, add config.middleware.delete Rack::Runtime to config/application.rb.
  • ASP.NET X-AspNet-Version: set <httpRuntime enableVersionHeader="false" /> in web.config. For X-AspNetMvc-Version, add MvcHandler.DisableMvcResponseHeader = true; to Application_Start.
  • Kestrel Server: Kestrel: builder.WebHost.ConfigureKestrel(o => o.AddServerHeader = false);
  • Behind Cloudflare, any stack: turn on the managed transform called Remove "X-Powered-By" headers under Rules. It strips the header at the edge whatever your origin sends, which helps when you can't change the app. Fix it at the source as well, so it stays fixed if you ever move off Cloudflare.

Check the fix on the live site

Test the deployed URL, not localhost. A proxy or CDN in front of your app can add headers your local server never sends.

Read your live response headers
curl -sI https://yourapp.com | grep -iE '^(server|x-powered-by|x-runtime|x-generator|x-aspnet)'

If x-powered-by is gone and server shows a host name with no version, you're done. If server still has a version number, something in front of your app is adding it: check your reverse proxy config before you go back to the framework.

This hides the label, not the version. Removing the header doesn't patch anything. A determined attacker can still fingerprint Next.js from its /_next/ asset paths. The point is to fall off the cheap automated lists, while the real protection stays where it always was: keeping the framework updated.

Have your AI editor do it

AI Prompt

Remove version-disclosing headers

My live site sends these response headers: (paste the output of the curl command above). For my stack, remove every header that reveals the framework or server version (X-Powered-By, a versioned Server header, X-Runtime, X-AspNet-Version). Change config only, don't add new dependencies unless helmet is already installed. Tell me which headers come from my hosting platform rather than my code and leave those alone. Then give me the curl command to confirm the change after deploy.

How do I remove the X-Powered-By header in Next.js?

Set poweredByHeader: false in next.config.js and redeploy. We built a fresh Next.js 16.4.6 app: the default build sent X-Powered-By: Next.js, and after adding poweredByHeader: false the header was gone.

How do I disable X-Powered-By in Express?

Call app.disable('x-powered-by') right after creating the app. Express 5.3.0 still sends X-Powered-By: Express by default; with that one line, the header disappears. If you already use helmet, it removes the header for you.

Is the X-Powered-By header a security vulnerability?

Not on its own. It tells an attacker which framework you run, which makes it faster to match your app against known exploits for that framework. Removing it costs one line and hides nothing important from you. Keeping the framework patched matters far more.

Can I remove the Server: Vercel or Server: cloudflare header?

Not from your app. Those are set by the host's edge after your code runs, and Cloudflare's docs list server among the headers its Transform Rules can't modify. They name the host, not a software version, so there's little for an attacker to look up. Leave them.

Why does my scan still show the Server header after I removed it?

Usually because a proxy in front of your app adds its own. Run curl -sI against your live URL, not localhost. If the value is your host's name, it comes from the edge, not your code.

See What Your Headers Say About You

A CheckYourVibe scan reads your live response headers from the outside and flags every one that names your framework or server version, along with the security headers you're missing.

How-To Guides

How to Remove the X-Powered-By Header (and the Server Header) in 2026