How to Hide Nginx Version

0

Full article

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.


We <3 coffee too

Help us to keep ebblr active and ad free.

Buy us a coffeeBuy us a coffee

Author

Comments