User Tools

Site Tools


ubuntu:nginx:hide_web_server_version_from_appearing_in_http_header

Ubuntu - nginx - Hide web server version from appearing in http header

Add this line into /etc/nginx/nginx.conf:

/etc/nginx/nginx.conf
...
server_tokens off
...

where this line of config will hide your nginx version number.


Restart or reload nginx

/etc/init.t/nginx restart

Check the nginx header

To check for the header, you can use curl:

curl -I www.foo.net

where -I is for curl to grab just the http header.

returns:

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Server: Apache/2.2.15 (Red Hat)
ubuntu/nginx/hide_web_server_version_from_appearing_in_http_header.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki