Sometimes hackers target your server with the banner-grabbing technique. Usually, banner grabbing is used for vulnerability assessment of the server by scanning your server for running services, open ports, and other information on the server.
Hiding your server version will effectively protect your server from such scanning tools, making it hard to determine the server's vulnerability.
You can check the Nginx server version by executing the command given below –
curl --head domain.com
Steps to Hide the Nginx Version
1. Open the Nginx configuration file using this command –
2. Now add the following line as shown below in the config file and save using the ctrl + x command –
Your Nginx version information will be hidden, making your server more secure.