As you install web server, in default it provides it’s name and version to the clients. It is an information leakage and it will help attackers to narrow down their attacks. Attackers searches the known vulnerabilities in the exploit databases and launch precise attacks on the server.
To find whether your web server is also leaking the same information
curl [target] -I
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Fri, 29 Dec 2017 04:37:43 GMT
Last-Modified: Tue, 26 Dec 2017 11:13:35 GMT
Apache and httpd
For Apache, edit your apache2.conf file. In default, the file will be at /etc/apache2/apache2.conf.
For httpd, edit your httpd.conf file. In default, the file will be at /etc/httpd/httpd.conf.
Append the lines below in the bottom of the file.
Header unset Server
sudo apt-get -y update
sudo apt-get install nginx-extras
Edit your nginx.conf file. In default, the file will be at /etc/nginx/nginx.conf. Find and uncomment the line.
Below the line, add following.