How to hide the Nginx version

In your terminal, enter the below command

sudo nano /etc/nginx/nginx.conf

Then find server_tokens in the file by pressing Ctrl + w and then entering search keyword

In the file remove # and it looks like the below

server_tokens off;

Then save the file by pressing Ctrl + o then press Enter key

Then exit from nano editor by pressing Ctrl + x

Then restart the Nginx server using the below command

sudo systemctl restart nginx

Leave a Reply