Table of Contents

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)