Home  >  Q&A  >  body text

How to hide the nginx version number and PHP version number in the header?

As the title states, how to hide the nginx version number and PHP version number in the header?
To prevent certain malicious scanning attacks.

伊谢尔伦伊谢尔伦2683 days ago650

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-05-16 17:27:55

    Turn off the nginx version number and add server_tokens off in the http section of conf/nginx.conf;

    Turn off the PHP version number, search expose_php in etc/php.ini and change it to Off(-- to determine whether to expose PHP installed on the server (for example, add its signature to the information header of the Web server: X-Powered-By: PHP /5.3.7)

    Restart nginx php

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 17:27:55

    keywords: nginx hide header version php

    http://www.andreaspollak.eu/2012/10/remove-php-x-powered-by-and-nginx-server-details-from-http-response-header/
    http://blog.laimbock.com/2014/04/11/how-to-remove-nginx-php-versions-from-http-header/

    reply
    0
  • Cancelreply