How to hide `Server:` Response info on NGINX
$ curl -I localhost HTTP/1.1 200 OK Server: nginx/1.4.6 (Ubuntu) Date: Fri, 11 Aug 2017 14:09:04 GMT Content-Type: text/html Content-Length: 612 Last-Modified: Tue, 04 Mar 2014 11:46:45 GMT Connection: keep-alive ETag: "5315bd25-264" Accept-Ranges: bytes
To hide `Server:` on HTTP Response, you need install nginx-extras instead nginx/nginx-core
Install nginx-extras on Ubuntu
apt-get install nginx-extras
add these line on http {}
vim /etc/nginx/nginx.conf http { server_tokens off; more_clear_headers Server; } reload/restart NGINXnginx -s reloadTest / check the result
you will see `Server: nginx/1.4.6 (Ubuntu)` is gone.$ curl -I localhost HTTP/1.1 200 OK Date: Sat, 12 Aug 2017 05:01:13 GMT Content-Type: text/html Content-Length: 612 Last-Modified: Tue, 04 Mar 2014 11:46:45 GMT Connection: keep-alive ETag: "5315bd25-264" Accept-Ranges: bytes