How to Hide the Nginx Version Number

Nginx displays a prominent version number in the HTTP header or on error pages. For security reasons, you should generally disable this information.

The method is very simple. Just add the server_tokens parameter inside the http { block in nginx.conf.
For example:

 
  1. http {  
  2. include       mime.types;  
  3. default_type  application/octet-stream;  
  4. server_tokens off;     #Disable version display  
  5. client_header_timeout       3m;  
  6. client_body_timeout         3m;  
  7. send_timeout                3m; 

If you want to modify the displayed Server name as well, refer to: http://www.oschina.net/bbs/thread/1568?lp=1

Leave a Comment

Your email address will not be published.