Many servers announce their software and version in every response — Server: Apache/2.4.1, X-Powered-By: PHP/8.1.2. That is a shortcut for anyone scanning for a known vulnerability. Turning the version off is cheap; keeping the software patched is what actually protects you.
| Headers | Server, X-Powered-By, X-AspNet-Version, X-Generator |
| OWASP advice | Remove X-Powered-By; remove Server or make it uninformative |
| Apache’s own view | Hiding Server adds no real security |
| What matters | Patching; hiding only removes a shortcut |
Check Server and X-Powered-By on your site
Enter a domain: we fetch its homepage and read every security header, this one first.
What it does
Server names the web server, X-Powered-By the language or framework, X-AspNet-Version the .NET version, X-Generator the CMS. With a version number attached, a scanner can match your site against lists of known vulnerabilities without probing it at all.
Opinions differ on how much hiding them helps: OWASP says remove them, while Apache’s own documentation and MDN note that software can be fingerprinted other ways. Both are right — removing the version is a small, free improvement, and no substitute for updating.
What to aim for
Server: Apache
(no X-Powered-By, X-AspNet-Version or X-Generator)
A bare product name like Apache, nginx or cloudflare gives little away — our check only flags headers that include a version.
How to turn them off
Apache
ServerTokens Prod
ServerSignature Off
In the main server configuration only — ServerTokens does not work in a virtual host or .htaccess. Prod leaves Server: Apache.
PHP
expose_php = Off
In php.ini — it cannot be changed with ini_set(). Removes PHP’s version from X-Powered-By.
nginx
server_tokens off;
fastcgi_hide_header X-Powered-By;
server_tokens off removes the version but keeps Server: nginx; fastcgi_hide_header stops PHP-FPM’s X-Powered-By.
IIS (web.config)
<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 needs IIS 10 on Windows Server or Windows 10 version 1709 or later; enableVersionHeader removes X-AspNet-Version.
Caddy
header -Server
header -X-Powered-By
Cloudflare
Managed Transforms: Remove “X-Powered-By” headers
Cloudflare does not let you change the Server header; it sends its own, Server: cloudflare.
Common mistakes
- Putting ServerTokens in .htaccess or a virtual host, where Apache ignores it.
- Expecting nginx’s server_tokens off to remove the Server header — it removes only the version.
- Trying to switch expose_php off with ini_set() — it only works in php.ini.
- Hiding the version instead of updating the software.
What we recommend
Turn the versions off — ServerTokens Prod, expose_php = Off, server_tokens off — and remove X-Powered-By. Then spend the effort that matters: keep the server, PHP and CMS up to date.
Questions
Does hiding the Server header make my site secure?
No. It removes a shortcut for automated scanners; software can still be identified other ways. Updates protect you, not the header.
Sources
Checked on 25 September 2026 against these official sources:
- core — Apache HTTP Server Version 2.4 — httpd.apache.org
- Module ngx_http_core_module — nginx.org
- PHP: Description of core php.ini directives — php.net
- Request Filtering <requestFiltering> — learn.microsoft.com
- HTTP Headers — cheatsheetseries.owasp.org