Here we will see how to hide the Nginx server version from error pages and the “Server HTTP” response header field in Linux. This is one of the most important security recommendations for your Nginx HTTP and proxy server.
The Nginx will show the version on error pages and in the “Server” response header field.
Hiding The Nginx version:
To hide the Nginx server version on Linux and Unix-like systems, set server tokens to off. Using a text editor like vim/nano, edit the nginx.conf file:
$ sudo nano /etc/nginx/nginx.conf
Now Uncomment server_tokken off:
Now save the file and restart Nginx server to take effect.
$ sudo systemctl restart nginx
Verify that Nginx version is hidden:
Now verify Nginx version hidden or not.
On Linux or Unix-based systems, we’ve shown you how to easily hide the Nginx version. Nginx plus (commercial/paid option) users can also create their own Nginx version.