The nginx Server response header may show the server’s version. You can suppress the version with server_tokens off, while keeping the software updated to address actual vulnerabilities.

Check the response header

Replace example.com with the actual site:

curl -I https://example.com/

Inspect the Server header. A reverse proxy or CDN may supply its own header, and a redirect response may come from a different server than the final page.

Hide the nginx version

You need administrator access to the nginx configuration. On a control-panel server, use the panel’s supported custom-configuration method to avoid changes being overwritten.

  1. Keep a copy of the current configuration.
  2. In the applicable http, server or location context, add or change:
server_tokens off;
  1. Test the configuration:
sudo nginx -t
  1. Only if the test succeeds, reload nginx. On a systemd installation:
sudo systemctl reload nginx
  1. Repeat the header check and test the site. Check for an overriding directive or an upstream proxy if the result differs.

This normally leaves Server: nginx while removing the version. It does not remove every identifying header or provide protection against unpatched software.