Hide Nginx Server Version in Linux

Hide Nginx Server Version in Linux


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:

sudo nano /etc/nginx/nginx.conf

Turn server_tokens off:

server_tokens off;

Then we need to save the config & restart Nginx server:

sudo systemctl restart nginx

Test

Now visit the 404 page and take a look:

 That’s all. Thanks for reading. ?

StarCode Kh

Website that learns and reads, PHP, Framework Laravel, How to and download Admin template sample source code free.

Post a Comment

Previous Post Next Post
close