The web server shows its version
- Check
http.version_banner- Severity
- info
- Runs
- on our side, against a domain you verified
- Looks at
- Server and X-Powered-By headers with version numbers
What the check looks at
Once a day we request the home page of the domain over HTTPS and read the Server, X-Powered-By,
X-AspNet-Version and X-AspNetMvc-Version headers. The check warns when one of them contains a version number,
for example Server: Apache/2.4.71 (Debian) or X-Powered-By: PHP/8.2.7. A product name without a version
(Server: nginx) passes.
Risk
A version number tells anyone which CVEs to try without probing, and scanners collect these headers to find versions with known bugs. Hiding it does not fix a vulnerability, and an attacker can often guess the version another way, so the severity is info. It keeps the server out of simple searches for one vulnerable version.
How to fix it
nginx
server_tokens off; # in http, server or location
The header becomes Server: nginx.
Apache httpd
ServerTokens Prod
ServerSignature Off
On Debian and Ubuntu, change them in /etc/apache2/conf-available/security.conf, which sets ServerTokens OS.
A separate file whose name sorts before security.conf is overridden: on Debian 12, a hardening.conf with
ServerTokens Prod still produced Server: Apache/2.4.71 (Debian). On the RHEL family, put them in
/etc/httpd/conf/httpd.conf or in /etc/httpd/conf.d/. The header becomes Server: Apache.
Caddy
Caddy sends Server: Caddy without a version. To remove the header:
header -Server
PHP
PHP adds X-Powered-By: PHP/<version>. Set this in php.ini (for PHP-FPM, the php.ini of the FPM SAPI) and
restart PHP-FPM:
expose_php = Off
Express and other frameworks
In Express (Node.js), app.disable('x-powered-by'). Other frameworks have similar settings.
Behind a reverse proxy, the proxy may pass on the header of the application. In nginx,
proxy_hide_header X-Powered-By; removes it.
How to check the fix
curl -sI https://example.com/ | grep -i -E '^(server|x-powered-by):'
After the changes above:
server: nginx
Check an error page too (curl -sI https://example.com/does-not-exist): some servers add a version to error pages
separately (Apache ServerSignature).
When a warning is fine
When a hosting provider or an appliance sets the header and you cannot change it. Keep that software updated.
Sources
- nginx: server_tokens and proxy_hide_header
- Apache: ServerTokens, ServerSignature
- Caddy: header directive
- PHP: expose_php, Express: security best practices
- Tested on 2026-11-26: nginx 1.26.3 (Debian 13), Apache 2.4.71 (Debian 12, with the
security.confoverride), Caddy 2.6.2 (Debian 13)