Hide Nginx Server Version in Linux
In this article, I’m going to show how to hide the Nginx server signature in Linux. Generally, on the 404 page, the server shows its version with the operating system name. To secure our server, we should hide this info. Let’s take a look at the solution.
Problem
The server is displaying its server and OS name:
Solution
The “server_tokens” directive shows the version and OS name. We need to turn it off. The server_tokens directive exists in /etc/nginx/nginx.conf configuration file.
Open the Nginx config file:
Turn server_tokens off:
Then we need to save the config & restart Nginx server:
Test
Now visit the 404 page and take a look:
That’s all. Thanks for reading. ?
Tags:
Linux