/ nginx

How to Hide Nginx Version

Hiding nginx version from showing on error pages/headers it's easy, to do that we need to set server_tokens off; on the nginx.conf file which is located to /etc/nginx/nginx.conf.

nginx

Step 1 - Open the file nginx.conf

sudo nano /etc/nginx/nginx.conf

Step 2 - Set server_tokens to off

We need to make sure that server_tokens is set to off and that it's not commented. After setting server_tokens to off, press ctrl+x to save changes and exit.

It should look like this.

nginx-conf-ebblr

Step 3 - Restart Nginx

/etc/init.d/nginx restart
or
service nginx restart

Once we restart the nginx server, we need to check server headers to verify that nginx version it's not showing on headers. You can use either curl to view http headers or any other http header checker you want.

Check server's headers via curl
curl -I http://yoursite.com

That's it!

In this tutorial we explained step by step how to hide nginx version.

How to Hide Nginx Version
Share this

Recent Posts

How to Stress Test your Web/App In this tutorial you'll learn how to stress test.. How to Hide Nginx Version Hiding nginx version from showing on error pages/h.. How to Install git on Linux and Windows In this tutorial you'll learn how to install git o..