PenTesting Company
Nighttime satellite view of the United States, showing city lights from coast to coast
← Blog

Hide the Nginx Server Header

13 min read

By default, Nginx sends a Server response header that reports the software and version, such as Server: nginx/1.26.3. To hide the version, add server_tokens off; to the http block and reload, which leaves Server: nginx. Removing the header entirely is not possible with a built-in directive in open-source Nginx. It needs the third-party headers-more module and more_clear_headers Server;, or more_set_headers to replace the value. Version disclosure is a minor issue on its own, and the sections below walk through each step with captured output.

Removing a different header, like X-Powered-By? Jump to the snippet builder.

Check your response headers

Paste raw curl -I, HEAD or GET response output, including the HTTP status line. For curl -IL, each response is shown separately, in pasted order. These are response blocks, not proof of distinct network hops.

Pasted text stays in your browser. Nothing is sent or stored.

Only pasted text is checked, not your live site. A truncated capture may omit fields. Check successful, redirect and error responses separately, including GET bodies. Hiding the version banner reduces information disclosure but is not security assurance.

Short answer

Add server_tokens off; and reload to hide the Nginx version in the Server header. The header then reads Server: nginx. The third-party headers-more module, or an equivalent module, can remove the header with more_clear_headers Server; or replace it with more_set_headers. After reload, verify with curl -I (or an equivalent header check) and read the Server line. Hiding the header is one small layer. It does not make Nginx secure.

# Default
Server: nginx/1.26.3

# After server_tokens off;
Server: nginx

# After more_clear_headers Server; (headers-more)
(no Server header)

These lines come from the captured curl -I output further down, on Debian 13 with nginx 1.26.3.

For a header that comes from an upstream app, such as X-Powered-By, use proxy_hide_header, or fastcgi_hide_header for PHP-FPM. The headers-more module's more_clear_headers can clear an output header, while add_header cannot remove a header. See the snippet builder for a specific name.

Nginx Server header config generator

Pick your setup to get a config snippet, an install command and a curl check. The snippet is built in your browser. What you enter is not sent or stored. Output is illustrative, so review it against your own setup before applying it.

Edition
Distribution
Behind a proxy or CDN?
Goal
1. Config
# /etc/nginx/nginx.conf (illustrative)
http {
    server_tokens off;
    # ... your existing settings ...
}

2. Install: Nothing to install. server_tokens is built in.

3. Check (replace example.com with your site)
sudo nginx -t && sudo systemctl reload nginx
curl -I https://example.com/
curl -I https://example.com/this-page-does-not-exist
# Expected Server line: Server: nginx

Why it still says nginx

What you seeWhat to check
Server: nginx/1.x.xConfig not reloaded, or server_tokens on in another block.
Server: nginxExpected with server_tokens off. Removal needs headers-more.
unknown directive "more_clear_headers"Module not installed or not loaded.
A different Server valueThe value may be overwritten or come from another server. A single header does not identify the responsible layer.
Version on error pagesserver_tokens off missing for that server block.

What the default looks like

The examples below were captured on Debian 13 with the packaged nginx/1.26.3 and libnginx-mod-http-headers-more-filter 0.38. With server_tokens left at its default of on, a plain request shows the full version:

$ curl -I http://127.0.0.1:8080/
HTTP/1.1 200 OK
Server: nginx/1.26.3
Date: Wed, 07 Oct 2026 14:09:39 GMT
Content-Type: text/html
Content-Length: 3
Connection: keep-alive
Accept-Ranges: bytes

Note that some distributions already ship with server_tokens off; in the default nginx.conf (the Debian package does), so check your actual output before assuming either way.

Turn off the version

Open your Nginx configuration file, usually at /etc/nginx/nginx.conf, and add server_tokens off; inside the http block:

http {
    # ...
    server_tokens off;
    # ...
}

The server_tokens directive is valid in the http, server, and location contexts. Setting it once in http covers every site; setting it in a server block covers only that site. After the change, the version is gone but the name stays:

$ curl -I http://127.0.0.1:8080/
HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html
...

Check the configuration and reload

Always test the configuration before reloading:

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

$ sudo systemctl reload nginx

If nginx -t reports an error, fix it before reloading. A reload keeps the running workers on the old configuration if the new one fails to load.

Removing or replacing the header with headers-more

Hiding the nginx name as well is not possible with a built-in directive. It requires the third-party headers-more module or a custom build. On Debian and Ubuntu the module is packaged:

sudo apt install libnginx-mod-http-headers-more-filter

On Debian and Ubuntu, the nginx-extras package also includes headers-more. On other systems, check your distribution's packages. On RHEL-family systems, for example, it may come from an add-on repository such as EPEL rather than the base repositories. If no package fits, the module can be built from source as a dynamic module, and it has to be built against the same nginx version you run.

The package enables the module with a load_module line under /etc/nginx/modules-enabled/, which belongs in the main (top-level) context. The more_clear_headers and more_set_headers directives go in http, server, or location. To remove the header completely:

server {
    listen 8080;
    server_tokens off;
    more_clear_headers Server;
}
$ curl -I http://127.0.0.1:8080/nope
HTTP/1.1 404 Not Found
Date: Wed, 07 Oct 2026 14:09:40 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive

To replace the value instead of removing it:

more_set_headers "Server: web";
$ curl -I http://127.0.0.1:8080/
HTTP/1.1 200 OK
Server: web
...

Without a module, open-source Nginx cannot change the name in the Server header. The server_tokens directive accepts on, off and build, which only control whether the version (and, with build, a build name) appears. Setting a custom string, or an empty string that stops the field being sent, is documented as part of the commercial subscription (NGINX Plus).

Remove any response header in nginx

The Server header is not the only one you may want to hide. Application frameworks often add X-Powered-By. See Remove the X-Powered-By Header for turning that header off in the application, and for a paste-in checker. Nginx can hide the header when it comes from an upstream, but the built-in add_header directive cannot remove a header that is already present.

Remove a response header: snippet builder

Type the header name and pick how nginx serves your app. You get the directive, where it goes and a check to run after reload. The snippet is built in your browser. What you enter is not sent or stored. Review the output against your own config before applying it.

Only the name, such as X-Powered-By or X-Generator. No colon or value.

How nginx serves the app
1. Config
location / {
    proxy_pass http://127.0.0.1:3000;   # your existing line
    proxy_hide_header X-Powered-By;
}

2. Where it goes: Put it in the location block that has your proxy_pass line, or in the server or http block to cover every proxied location. It only hides the header when the upstream sends it, not when nginx adds it.

3. Reload and check (replace example.com with your site)
sudo nginx -t && sudo nginx -s reload
curl -sI https://example.com/ | grep -i '^X-Powered-By:'
curl -sI https://example.com/this-page-does-not-exist | grep -i '^X-Powered-By:'
# No output means the header was not in that response.
  • If this location already has other proxy_hide_header lines, keep them all together. A location with any proxy_hide_header line stops inheriting the ones set in server or http.

Hiding a header reduces what a visitor learns about your stack. It is not a fix for any vulnerability behind it.

When Nginx proxies an HTTP upstream, proxy_hide_header sets additional fields that will not be passed from that upstream to the client. In our test, a loopback upstream sent X-Powered-By: ExampleFramework/4.2. Without the hide directive, curl -I showed the header. After proxy_hide_header X-Powered-By;, that header was gone. The Server: nginx header that Nginx adds itself was unchanged.

server {
    listen 8080;
    server_tokens off;
    location / {
        proxy_pass http://127.0.0.1:8081;
        proxy_hide_header X-Powered-By;
    }
}
$ curl -I http://127.0.0.1:8080/
# Before proxy_hide_header
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 11 Nov 2026 16:29:01 GMT
Content-Type: text/html
Content-Length: 3
Connection: keep-alive
X-Powered-By: ExampleFramework/4.2

# After proxy_hide_header X-Powered-By;
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 11 Nov 2026 16:29:01 GMT
Content-Type: text/html
Content-Length: 3
Connection: keep-alive

For FastCGI upstreams, including PHP-FPM, the matching directive is fastcgi_hide_header. We verified it against a controlled FastCGI upstream that sent the same X-Powered-By value. After fastcgi_hide_header X-Powered-By;, that header was absent, and Server: nginx was still present.

location / {
    # PHP-FPM often listens on 127.0.0.1:9000 or a unix socket
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_hide_header X-Powered-By;
}

Both directives apply only to headers received from the upstream. They do not remove headers Nginx adds itself, such as Server.

Other upstream types have the same directive: uwsgi_hide_header for uWSGI, scgi_hide_header for SCGI and grpc_hide_header for gRPC. Each one also has a short default list that Nginx never passes. For proxied and gRPC upstreams it is Date, Server and X-Accel-..., plus X-Pad for proxied ones. For FastCGI, uWSGI and SCGI it is Status and X-Accel-.... Header names are not case sensitive. In our test, proxy_hide_header x-powered-by; hid X-Powered-By just the same.

Watch how these directives inherit. The documentation does not spell it out for proxy_hide_header, so we tested it on the same nginx 1.26.3 build. With proxy_hide_header X-Powered-By; at the server level and no hide line in the location, the header was hidden. Adding proxy_hide_header X-Generator; inside the location brought X-Powered-By back. fastcgi_hide_header behaved the same way. If a location has any hide line of its own, list every header you want hidden there.

server {
    listen 8080;
    server_tokens off;
    proxy_hide_header X-Powered-By;

    location / {
        proxy_pass http://127.0.0.1:8081;
        proxy_hide_header X-Generator;   # replaces the server-level list
    }
}
$ curl -I http://127.0.0.1:8080/
# Without the location-level line: X-Powered-By hidden
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 17 Nov 2026 14:54:10 GMT
Content-Type: text/html
Content-Length: 3
Connection: keep-alive
X-Generator: ExampleCMS
X-Hidden-One: 1
X-Hidden-Two: 2

# With proxy_hide_header X-Generator; in the location
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 17 Nov 2026 14:54:10 GMT
Content-Type: text/html
Content-Length: 3
Connection: keep-alive
X-Powered-By: ExampleFramework/4.2
X-Hidden-One: 1
X-Hidden-Two: 2

The built-in add_header directive cannot remove a header. It only adds a field. In our test, add_header X-Content-Type-Options "nosniff"; on the proxied location added that field and left X-Powered-By in place. An empty add_header X-Powered-By ""; also left the upstream header in place. See the official add_header documentation.

location / {
    proxy_pass http://127.0.0.1:8081;
    add_header X-Content-Type-Options "nosniff";
}
$ curl -I http://127.0.0.1:8080/
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 11 Nov 2026 16:29:01 GMT
Content-Type: text/html
Content-Length: 3
Connection: keep-alive
X-Powered-By: ExampleFramework/4.2
X-Content-Type-Options: nosniff

The third-party headers-more module can clear any output header, not only Server, with more_clear_headers. In our test, more_clear_headers X-Powered-By; on the proxied location removed that header:

location / {
    proxy_pass http://127.0.0.1:8081;
    more_clear_headers X-Powered-By;
}
$ curl -I http://127.0.0.1:8080/
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 11 Nov 2026 16:29:01 GMT
Content-Type: text/html
Content-Length: 3
Connection: keep-alive

The headers-more README describes two ways it differs from the built-in directives. A * at the end of a name is a wildcard, so more_clear_headers 'X-Hidden-*'; clears every header that starts with X-Hidden-. The *_hide_header directives match the name literally, and in our test proxy_hide_header "X-Hidden-*"; hid nothing. Also, headers-more directives inherited from http or server run before the ones in the location, so a location's own more_clear_headers adds to them instead of replacing them. Our test showed both.

Two limits apply. The README says the module cannot remove the Connection header, because the Nginx core adds it later. In our test, it also did not remove a header that the same configuration set with add_header, so delete that add_header line instead. It did remove headers Nginx sets itself on static files, such as ETag.

You can paste the same curl -I output into the response header checker earlier on this page. It already flags X-Powered-By when that field is present. Hiding a banner reduces information disclosure. It is not security assurance.

There is also an inheritance gotcha with add_header. The official documentation says these directives are inherited from the previous configuration level if and only if there are no add_header directives defined on the current level. An add_header in a location block therefore drops add_header lines set at the server or http level.

server {
    listen 8080;
    server_tokens off;
    add_header X-Frame-Options "DENY";
    add_header X-Content-Type-Options "nosniff";

    location /static/ {
        add_header Cache-Control "public, max-age=86400";
    }
}
$ curl -I http://127.0.0.1:8080/
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 11 Nov 2026 16:29:01 GMT
Content-Type: text/html
Content-Length: 28
Last-Modified: Wed, 11 Nov 2026 16:28:46 GMT
Connection: keep-alive
ETag: "6af497be-1c"
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Accept-Ranges: bytes

$ curl -I http://127.0.0.1:8080/static/
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 11 Nov 2026 16:29:01 GMT
Content-Type: text/html
Content-Length: 35
Last-Modified: Wed, 11 Nov 2026 16:28:46 GMT
Connection: keep-alive
ETag: "6af497be-23"
Cache-Control: public, max-age=86400
Accept-Ranges: bytes

The / response kept both server-level headers. The /static/ response kept only Cache-Control. The two security headers were dropped. These captures are from nginx 1.26.3, the same packaged build as earlier in this post. On this version, add_header_inherit is an unknown directive; nginx -t rejected it. Starting in 1.29.3, the add_header_inherit directive can change the rule. The default is add_header_inherit on;, which keeps the behavior above. Setting add_header_inherit merge; appends values from the previous level to the values defined at the current level. If your nginx is older than 1.29.3, repeat the important headers inside the location block, or keep all add_header lines at one level.

Server block

add_header X-Frame-Options "DENY";
add_header X-Content-Type-Options "nosniff";

Request to /

No add_header in this location

  • Server-level headers are inherited.
  • Response includes X-Frame-Options: DENY and X-Content-Type-Options: nosniff.

Request to /static/

Location sets its own add_header

  • Location has add_header Cache-Control "public, max-age=86400";
  • Response includes Cache-Control: public, max-age=86400 only. The two server-level headers are dropped.
Default add_header inheritance, captured on nginx 1.26.3 with the configuration above. Starting in 1.29.3, add_header_inherit merge; can keep the inherited headers as well. The default remains add_header_inherit on;, which keeps the rule shown here.

Error pages expose the version too

The built-in error pages print the server name in the body. With the default setting, a 404 page ends like this:

$ curl -s http://127.0.0.1:8080/nope
...
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.26.3</center>

In our test, more_clear_headers Server; on its own removed the header but left nginx/1.26.3 in the error page body. Adding server_tokens off; reduced the body to nginx. If you want the name gone from error pages as well, serve your own pages with the error_page directive.

server_tokens or headers-more?

  • server_tokens off; is built in, needs no extra module, and hides the version in both the Server header and the default error pages. The name nginx remains.
  • headers-more can remove or rewrite the Server header entirely, but it is a third-party module you have to install and keep updated, and it does not change the error page body.
  • For most teams, server_tokens off; is enough. If you also want the name gone, use both together, plus custom error pages.

Other headers that leak recon information

The Server header is not the only one. Several others describe your software stack, and visitors can read all of them. They are usually set by the application, framework, or an upstream proxy rather than by Nginx itself. That means the lasting fix is often in the application's own configuration. In Nginx you can reduce what reaches the public, but only for responses it passes through from an upstream. Headers Nginx adds directly are not affected by these directives.

  • X-Powered-By. This names the framework or runtime behind the application and sometimes its version. It tells a visitor which technology to look up. Application frameworks usually set it themselves, so turn it off in the framework where you can. In Nginx, hide it from proxied responses with proxy_hide_header X-Powered-By;, or with fastcgi_hide_header X-Powered-By; when you pass requests to FastCGI.
  • Via and similar proxy headers. These show that a proxy, cache, or gateway sits in the path, and can include the software name or an internal hostname. Nginx does not normally add Via by default, but an upstream or another proxy in the chain may. To stop an upstream value passing through, use proxy_hide_header Via;. Some proxies and CDNs add their own headers after Nginx, so check what leaves your outermost layer.
  • Version banners such as X-AspNet-Version and X-Generator. X-AspNet-Version reports the ASP.NET version in use, and X-Generator is often set by a content management system to name itself. Both are set by the application or its platform. Switch them off there first, then add proxy_hide_header X-AspNet-Version; and proxy_hide_header X-Generator; as a second layer.
  • Default error pages from an upstream server. A default error page from an Apache upstream can print a line such as Apache/2.4.x (Debian) Server at example.com Port 80. Reduce it at the source with Apache's ServerTokens Prod and ServerSignature Off, and in Nginx let your own pages answer upstream errors with proxy_intercept_errors on; and error_page. For Nginx's own pages, server_tokens off; is covered above.

Here is a small configuration that applies these directives to a proxied location. The before and after headers are illustrative, not captured from a real system. Adjust the upstream name and the header list to what your own responses show.

server_tokens off;

location / {
    proxy_pass http://app_backend;
    proxy_hide_header X-Powered-By;
    proxy_hide_header X-AspNet-Version;
    proxy_hide_header X-Generator;
    proxy_hide_header Via;
    proxy_intercept_errors on;
}

# For a FastCGI upstream, use this instead of proxy_hide_header:
# fastcgi_hide_header X-Powered-By;
# Illustrative: before
HTTP/1.1 200 OK
Server: nginx/1.26.3
X-Powered-By: ExampleFramework/4.2
X-AspNet-Version: 4.0.30319
Via: 1.1 internal-cache

# Illustrative: after
HTTP/1.1 200 OK
Server: nginx

Test with sudo nginx -t and reload as before, then request a page and an error page and read the headers again. Hiding these headers reduces what a casual visitor learns. It is one small layer, not a defence on its own, and it does not fix any vulnerability behind it. If you would like to see what your public surface actually reveals, we can run a scoped external test against a scope we agree together. Contact us to get started.

Which server added the header?

When Nginx proxies an application, a public Server header can come from two places. The captured curl -I output earlier in this post shows the one Nginx adds itself: Server: nginx after server_tokens off;.

A CDN or load balancer in front of Nginx can also add or overwrite the header, so the public value is whatever the outermost hop sends. The diagram below shows that path. It is illustrative only.

  1. 1

    Upstream app

    May set Server

    • Nginx does not pass Server from a proxied upstream by default.
    • Use proxy_pass_header Server to allow that upstream value through.
    • Use proxy_hide_header for additional upstream headers, or for Server if that value was allowed through.
  2. 2

    Nginx

    Adds its own Server header

    • server_tokens off hides the version and leaves Server: nginx.
    • more_clear_headers Server, from the third-party headers-more module, can remove that header.
    • proxy_hide_header does not remove the Server header Nginx adds itself.
  3. 3

    CDN or load balancer

    Optional hop in front of Nginx

    • This layer can add or overwrite Server after Nginx has set it.
    • Check that product's own header settings. There is no single Nginx directive for a CDN in front of you.
  4. 4

    Client

    Sees the public response

    • Verify with curl -I against the public hostname, including any CDN or load balancer in front of Nginx.
Illustrative only. On a request to example.com, a Server header can be added or overwritten at the upstream app, at Nginx, or at a CDN or load balancer in front of Nginx. Check the public response at the outermost hop.

Directive behavior follows the official Nginx documentation for server_tokens and proxy_hide_header, and the headers-more README for more_clear_headers.

Where a Server header can come from when Nginx proxies an upstream, which directive applies, and the limit of each directive
HeaderWhere it comes fromDirective that appliesLimit
Server from the proxied upstreamThe application or server behind Nginx. By default, Nginx does not pass Server, Date, X-Pad, or X-Accel-* from a proxied upstream. That Server value reaches the client only if you allow it with proxy_pass_header Server;.proxy_hide_header, as in the proxy snippet above (for example proxy_hide_header X-Powered-By;). Use it for additional upstream headers, or for Server if that upstream value has been allowed through.It only controls headers received from the proxied upstream. It does not remove the Server header that Nginx adds itself.
Server that Nginx adds itselfNginx. The captured output earlier in this post shows Server: nginx/1.26.3 by default, and Server: nginx after server_tokens off;.server_tokens off; hides the version only. more_clear_headers Server; from the headers-more module (see the snippet above), or a separate layer that removes the header, can take Server: nginx off the response.In open-source Nginx, server_tokens off; leaves Server: nginx. Open-source Nginx has no built-in directive that removes this header. Hiding or removing it is a minor hardening step. It does not make the server secure.

Verification checklist

  • Run sudo nginx -t and confirm it reports the test is successful.
  • Reload with sudo systemctl reload nginx.
  • Run curl -I https://your-site/ and check the Server line.
  • Request a page that does not exist and check both the header and the body: curl -si https://your-site/does-not-exist.
  • Repeat for every server block and any proxy or CDN in front of Nginx, since those can add their own Server header.

What this does and does not do

Hiding the version makes simple version fingerprinting harder. It does not fix any vulnerability, and other techniques can still identify the server. Keeping Nginx patched and up to date matters far more than what the header says.

What an external penetration test looks at beyond the Server header: an illustrative example

This is an illustrative scenario, not a real client or case study.

Hiding the version is one small fix. If you run internet-facing servers and are deciding whether to bring in a tester, it helps to know what else an external test reviews and what you get at the end.

The scenario

A small company runs an Nginx reverse proxy in front of its web application. On the same public IP range it also exposes a VPN gateway for remote staff and a mail server.

How scope is agreed

Before any testing starts, the client and the tester align on:

  • The public IP ranges and hostnames that are in scope.
  • Confirming with the client before testing any subdomain discovered during the engagement that was not on the agreed list.
  • A testing window that suits the client's operations.
  • A named client contact to reach right away if a critical-severity issue turns up.

What the tester reviews

  • Internet-facing inventory. Which hosts and services in the agreed ranges actually answer from the internet, compared with what the team expects to be exposed.
  • Service identification. What software and versions are running. Hiding the version header makes this a bit harder, but it does not prevent it, because behavior, error pages, and other responses still give clues. That is why patching matters more than the header.
  • TLS configuration. Which protocol versions and ciphers are accepted, and whether certificates are valid and cover the right names.
  • Admin and status pages. Dashboards, status pages, and management interfaces that should only be reachable internally.
  • Directory listing. Folders that show their contents to anyone who browses to them.
  • Forgotten default virtual hosts. What the server returns for its bare IP address or an unexpected hostname. This is often an old or test site that nobody maintains.
  • Source-control folders and backup files. Leftovers such as a .git folder or archived copies of configuration files sitting in a web root.
  • Proxy and alias path configuration. Location, alias, and proxy rules that map URLs to files or upstream services in ways the team did not intend.
  • The VPN and mail services. Whether they are patched, how they handle sign-in, whether multi-factor authentication is enforced where expected, and whether the mail server relays mail it should not.

Example findings

A real report covers every confirmed finding. These four hypothetical rows show the level of detail each one carries. Severity depends on context, so these ratings apply to this example setup only.

Four hypothetical example findings from an illustrative external penetration test
Example findingSeverityWhat was observedBusiness impactRemediation guidance
Status page reachable from the internetMediumThe nginx status page on the main web hostname answered requests from any address and showed live connection and request counts.Outsiders could see operational details about the server and its traffic that help them plan and time further activity.Restrict the page with allow and deny rules so only internal addresses can reach it, or move it to a listener that is only reachable internally.
A .git folder served by a forgotten virtual hostHighAn old staging hostname that still pointed at the server served the application's .git folder from its web root.Anyone could retrieve the application's source code and history, including any credentials that were ever committed.Remove the folder and the unused virtual host, deny hidden paths, rotate any secrets found in the history, and add a catch-all default server.
Alias path misconfiguration exposes files outside the intended folderHighA location for static files and its alias used mismatched trailing slashes, so the server would also serve files from the folder above the intended one, including application configuration.Configuration files and the credentials in them could be read from the internet.Make the trailing slashes on the location and the alias match, and keep sensitive files out of folders next to a web root.
TLS allows outdated protocol versionsLowThe reverse proxy still accepted TLS 1.0 and TLS 1.1 connections alongside TLS 1.2 and TLS 1.3.Older clients could connect using protocols with known weaknesses, and the setup falls short of common configuration baselines.Allow TLS 1.2 and 1.3 only, then confirm the change from an external host.

Remediation snippets for the example findings

These short Nginx examples match the fixes above. We checked each one with nginx -t on nginx 1.26.3. Adjust addresses, hostnames, and paths to your setup, and test before reloading.

Limit the status page to local and internal addresses:

location = /nginx_status {
    stub_status;
    allow 127.0.0.1;
    allow 10.0.0.0/8;
    deny all;
}

Deny hidden paths such as .git while keeping /.well-known/ available for certificate renewal:

location ~ /\.(?!well-known/) {
    deny all;
}

Add a catch-all default server so unknown hostnames and the bare IP address do not land on a forgotten site. The ssl_reject_handshake directive needs nginx 1.19.4 or later:

server {
    listen 80 default_server;
    listen 443 ssl default_server;
    server_name _;
    ssl_reject_handshake on;
    return 444;
}

Keep the trailing slashes on the location and the alias matched:

location /static/ {
    alias /var/www/app/static/;
}

Allow TLS 1.2 and 1.3 only, in the http or server block:

ssl_protocols TLSv1.2 TLSv1.3;

The report and the readout

The report describes the agreed scope and testing window, gives a short summary for leadership, and lists each confirmed finding with its severity, what was observed, the business impact, and remediation guidance. After the report is delivered, a readout call walks your team through the findings and helps you decide what to fix first.

Retest terms set in the statement of work.

A penetration test is not a compliance certification. It gives you independent evidence of testing that can be one input to a broader security or compliance program.

If your public footprint looks like this scenario, read about our network penetration testing service or contact us to agree a scope.

Frequently asked questions

Can I remove the Server header without a module?

Not with stock open-source Nginx. The built-in server_tokens off; directive hides the version, but the header itself stays as Server: nginx. Removing it entirely needs the third-party headers-more module, a custom build, or a proxy or CDN layer in front of Nginx that strips the header.

Does hiding the Server header make Nginx secure?

No. Hiding the version is one small layer that reduces simple version fingerprinting. It does not fix any vulnerability, and other techniques can still identify the server. Keeping Nginx patched and well configured matters far more.

How do I check that it worked?

Run sudo nginx -t, reload, then run curl -I against your site and read the Server line. Also request a page that does not exist, because default error pages can show the version in the body. Check every server block and any proxy or CDN in front of Nginx.

Where do I put server_tokens off;?

In the http block to cover every site, or in a server or location block to cover only that part. The directive is valid in all three contexts.

Why does proxy_hide_header not remove Server: nginx?

proxy_hide_header controls headers received from a proxied upstream. It does not remove the Server header that Nginx adds itself. In open-source Nginx, server_tokens off hides the version but leaves Server: nginx. Removing that header needs a suitable module such as headers-more, or a separate layer that removes it. Check the public response after reloading.

Nighttime satellite view of the United States, showing city lights from coast to coast

Have a system you want tested?

Tell us what you are working with and we will follow up with next steps.