All posts
·8 min read·security · http headers · server configuration

Your server is telling strangers its version number: the Server and X-Powered-By headers

Stop announcing your server version with one config line per stack. What the Server and X-Powered-By header values reveal, and why hiding them is not a patch.

Request the homepage of a typical small business website and, before a single line of HTML arrives, the response headers may have already introduced the server: Server: Apache/2.4.52 (Ubuntu), followed by an X-Powered-By header reading PHP/8.1.2. Nobody asked for that. Browsers ignore it. Visitors never see it. The main audience for those two lines is automated software keeping a catalog of what runs where, and which of it is old.

Here is what those headers give away, the config line that quiets each common stack, and why quieting it is not fixing it.

What the Server and X-Powered-By headers give away

Server is a standard HTTP header that names the software producing the response. The spec itself discourages oversharing. RFC 9110 says an origin server should not send a Server value with needlessly fine-grained detail, because it can make known security holes easier to find and exploit.

X-Powered-By is not in any standard. Application runtimes add it on their own: PHP sends its exact version by default, IIS adds ASP.NET, Express adds Express, and Next.js adds Next.js. Classic ASP.NET adds a third header, X-AspNet-Version, with the framework build number.

Here is what a leaky response looks like next to a quiet one:

| Header | Leaky value | After the fix | |---|---|---| | Server (Apache) | Apache/2.4.52 (Ubuntu) OpenSSL/3.0.2 | Apache | | Server (nginx) | nginx/1.18.0 (Ubuntu) | nginx | | X-Powered-By (PHP) | PHP/8.1.2 | removed | | X-AspNet-Version | 4.0.30319 | removed |

A bare Server: nginx tells a stranger which product you run and nothing else. nginx/1.18.0 names a specific release with a specific, public list of fixed vulnerabilities. The number is the problem, not the name.

How one response becomes a vulnerability match

Internet-wide scanners are not looking for you specifically. They request the front page of every address and domain they can reach, record the headers, and index them. When a vulnerability is published for a given release, finding targets is a lookup: every host whose banner reports an affected version goes on the list. No probing, no guessing, nothing in your logs beyond one ordinary request that may have happened weeks earlier.

That is why the version string matters more than the product name. "Runs Apache" describes millions of servers. "Runs Apache 2.4.52" can be cross-referenced against public CVE databases in a single query. So can "PHP 8.1," a branch that stopped receiving security fixes at the end of 2025.

One caveat cuts both ways. Ubuntu, Red Hat, and other distributions backport security fixes into older version numbers, so Apache/2.4.52 (Ubuntu) may be fully patched even though upstream 2.4.52 is not. The scanner reading the header cannot tell, so you get flagged either way. Whether you are actually exposed is answered by the package changelog on the server, not the banner.

Hiding the version is hygiene, not a patch

This is the part that gets lost. Removing the version from your headers changes what the server says. It does not change what the server is. An Apache build with a known path-traversal bug still has that bug after ServerTokens Prod. A PHP release past end of life still receives no fixes after expose_php = Off.

Plenty of attack tooling never reads banners at all. It fires the exploit at every host on a list and sees what breaks, and a hidden version does nothing against that. What hiding buys you is smaller but real: you drop out of the cheapest targeting, the version-indexed search, and stop handing over a precise software inventory for free. That is worth one line of config. It is not worth marking the job done.

The stack itself stays visible regardless. /wp-content/ paths in your HTML say WordPress. A PHPSESSID cookie says PHP. Technology detection tools read these signals alongside the headers, so the goal is not invisibility. It is to stop publishing the exact release number.

So the order is: patch first, then hide. If the version in your header is old, the header is only the messenger.

Removing the X-Powered-By header and server version, stack by stack

Each fix below is a line or two in a config file you or your host already have.

Apache

In the main server config (httpd.conf, or conf-enabled/security.conf on Debian and Ubuntu):

ServerTokens Prod
ServerSignature Off

ServerTokens Prod trims the header to Server: Apache. ServerSignature Off removes the version footer Apache prints on its own error pages and directory listings. Neither directive is allowed in .htaccess, so on shared hosting this is a request for your host. Reload Apache after the change.

nginx

Inside the http { } block of nginx.conf:

server_tokens off;

That leaves Server: nginx and strips the version from nginx's built-in error pages. Removing the header entirely needs the third-party headers-more module, which the product name alone does not justify. If nginx hands requests to PHP-FPM, add fastcgi_hide_header X-Powered-By; (or proxy_hide_header X-Powered-By; in front of a proxied app) so the backend's header does not pass through.

PHP

In php.ini:

expose_php = Off

The PHP manual marks this as a system-level setting, so it belongs in php.ini or your host's PHP settings panel. Calls to ini_set() and .user.ini files cannot change it. Restart PHP-FPM or Apache afterward. If you only have .htaccess access and mod_headers is enabled, Header unset X-Powered-By strips the header at the web server instead.

IIS and ASP.NET

In web.config (the removeServerHeader attribute needs IIS 10 or later):

<system.webServer>
  <security>
    <requestFiltering removeServerHeader="true" />
  </security>
  <httpProtocol>
    <customHeaders>
      <remove name="X-Powered-By" />
    </customHeaders>
  </httpProtocol>
</system.webServer>
<system.web>
  <httpRuntime enableVersionHeader="false" />
</system.web>

removeServerHeader drops Server: Microsoft-IIS/10.0, the custom header removal handles X-Powered-By: ASP.NET, and enableVersionHeader="false" removes X-AspNet-Version.

Node and Next.js

Express: app.disable('x-powered-by'). Next.js: poweredByHeader: false in next.config.js. Neither runtime includes a version number, so this one is purely about not advertising the framework.

Why Squarespace, Wix and Shopify sites can skip this

If your site runs on a hosted platform, there is no server config for you to edit, and you do not need one. The platform runs the servers, patches them on its own schedule, and controls every header in the response. Whatever its Server header says describes the platform's infrastructure, not software you are responsible for upgrading.

This fix is for sites on servers you or your host configure: shared hosting, VPS, and dedicated machines, where an old version string usually points at a server nobody has touched in a while.

Check your own headers in ten seconds

From any terminal:

curl -sI https://yourdomain.com | grep -iE '^(server|x-powered-by|x-aspnet-version):'

Then load a page that does not exist, since Apache and nginx can print a version on error pages even after the headers are clean:

curl -s https://yourdomain.com/this-page-does-not-exist | tail -n 5

Two things can mislead you. First, a CDN or reverse proxy often rewrites the Server header to its own name, so the origin looks clean while the machine behind it runs whatever it runs. X-Powered-By usually passes through the CDN untouched. (MDN's Server reference covers what the header is meant to carry.)

Second, headers are not the only place a version leaks. A forgotten diagnostic page prints the exact PHP version and much more, a separate problem covered in seven files a scan looks for that should never answer 200.

How AcuityScan reports it

The scan treats disclosure and age as separate findings, because they are. The Server header is flagged only when it carries a version number, since a bare product name tells a stranger very little. X-Powered-By is flagged whenever it is present. Both land as low-severity, low-effort fixes. A separate check compares any version it finds against known patched releases for Apache, nginx, PHP, IIS, and OpenSSL, and that is where severity climbs to warning or critical, with the upgrade path for your stack attached.

For a quick look, the HTTP headers tool shows every header your site sends, and tech lookup shows your Server and X-Powered-By values next to the rest of the stack it detects. For the full picture, run a scan from acuityscan.com: 350+ checks across 8 modules, each finding paired with the config change that fixes it.

TL;DR

  • Server and X-Powered-By announce your software, often with its exact version, to anyone who asks.
  • A version string lets automated scanners match your site to known vulnerabilities from one request.
  • Hiding it takes one line per stack: ServerTokens Prod (Apache), server_tokens off (nginx), expose_php = Off (PHP), removeServerHeader (IIS).
  • Hiding is not patching. An outdated server is still outdated with a clean header, so upgrade first.
  • Squarespace, Wix, and Shopify control their own headers and patching.

Scan your own site

See what 350+ checks find on your domain.

Free, no signup, 60 seconds. Email auth · DNS · SSL · Performance · SEO · Accessibility · Privacy · Mobile.