AtulHost
  • Business
    • Career and Education
    • Finance and Investments
    • Marketing Strategies
  • Productivity
  • Technology
    • Consumer Electronics
    • Solar Energy
  • Tutorials

How to Hide Nginx Version?

By AtulHost in Tutorials ⋅ April 16th, 2015
Facebook Tweet LinkedIn

Sometimes due to lack of time it is difficult to update the software and you end up with running old vulnerable version. In this cases, it comes to handy to know how to hide nginx version or turn off server signature in nginx from all the public. Hiding nginx version is too easy which can be done by using server_tokens directive.

Also read: What is Nginx : How Nginx Works

To hide nginx version we need to edit nginx.conf file ( located at /etc/nginx/nginx.conf or /usr/local/nginx/conf/nginx.conf ). You can use editor like nano to modify the file. The server_tokens variable can be used either in the http, server or location sections. Just set it to off, as shown below:

Just add below directive to inside anywhere in http { … }.

server_tokens off;

See below image for reference.

nginx.conf

Once you added the code simply save it and restart nginx to make directive active.

service nginx restart

To check results, you can fetch the headers live from any console using curl command.

curl -I http://www.YourWebsite.com

Now you can see that no nginx version appearing and what you can see is just “nginx”.

Also read: How to Improve Nginx Performance : Quick Tips

This way you can hide nginx version or server signature.

Content is tagged with nginx, web server.
Facebook Tweet LinkedIn

You’ll also like:

  • How to reduce initial server response time?
  • 6 Reasons Why Hosting Companies Should Focus on Regular Data Center Maintenance
  • How to check Nginx version?
  • How to reduce server response times?
  • Nginx Performance Tuning
  • Apache vs. Nginx: Selection of a Perfect Web Server
  • How to redirect 404 to homepage in Nginx?
  • Things to consider when developing your own website
  • What is Nginx? How Does it Work? Explained
  • How to fix “Specify a Vary: Accept-Encoding Header” warning?

Published by AtulHost

Atul is a creative blogger who loves to do experiments with the latest business initiatives and tech trends like automation, artificial intelligence, cloud and edge computing, data science, hardware as well as networking, and the internet of things.

Make a comment Cancel reply

Required fields are asterisked and your email address will not be shared.

Subscribe

Recent Posts

  • HR trends for 2021
  • How to pick the right financing company for your customers
  • How to reduce initial server response time?
  • What every ecommerce business needs to know when it comes to product images
  • What is shared hosting?
  • How your online business can be everything a customer needs it to be?
Taking care of communication within your small business
Cool business ideas

We serve cookies on this site to offer the excellent user service.

  • About
  • Contact
  • Privacy Policy
  • Terms and Conditions
  • Write for Us
This website and its content are copyrighted © 2014-2021 by atulhost.com and individual contributors.