How to change(Hide) the Nginx Server Signature?

前端 未结 5 1874
花落未央
花落未央 2020-12-28 14:44

I can hide Nginx version by using server_tokens option set to off. But not able to change the Nginx Server signature.

Steps I did,

1.) Change the Nginx serve

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-28 15:30

    If you are working in ubuntu then

    1. First install nginx-extras

      sudo apt-get install nginx-extras
      
    2. Go to /etc/nginx/nginx.conf and under http add:

      http {
          more_set_headers "Server: Your_New_Server_Name";
          server_tokens off; 
      }
      
    3. Restart nginx

      sudo service nginx restart
      

提交回复
热议问题