Hide the version number of the service

Hide the Apache version number:

1>curl --head 127.0.0.1


15572212-3d74e5a85be7563e.png
image.png

2> Vim /etc/httpd/conf/httpd.conf
. 3> to the OS ServerTokens ServerTokens productonly


15572212-5f5ab09dd59acd3d.png
image.png

4>systemctl restart httpd
5>curl --head 127.0.0.1


15572212-6e656047c6a9399a.png
image.png

Hide PHP Version:

1>curl --head 127.0.0.1


15572212-b17452d07fc46c83.png
image.png

2> Vim /etc/php.ini
. 3> = ON to the expose_php expose_php = off


15572212-a70135ddd29ac365.png
image.png

4>systemctl restart httpd
5>curl --head 127.0.0.1


15572212-a24b352043185555.png
image.png

Hide Nginx version number:

1. Open the Main Nginx configuration file: nginx.conf, cancel or add comments configuration statement.
1> curl --head 127.0.0.1


15572212-e2c5159cf0bd41cd.png
image.png

2> Vim /etc/nginx/nginx.conf
. 3> {# ... HTTP some configurations will be omitted
server_tokens off; # is commented out
# some configurations will be omitted ...}


15572212-d4449f521a1be50d.png
image.png

. 4> systemctl the restart Nginx
. 5> curl --head 127.0.0.1
2, edit php-fpm profile, such as fastcgi.conf or fcgi.conf (this configuration
file name can also be custom tailored to the specific file name):

find / -name fastcgi.conf -o -name fcgi.conf

fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
改为:
fastcgi_param SERVER_SOFTWARE nginx;


15572212-4d915d0be52e377f.png
image.png

3, nginx reload configuration
Servic nginx reload
reload reload configuration can continue business, it can also be considered directly restart.
systemctl restart nginx
This completely hides the Foreign nginx version number, and so is the emergence of 404,501 pages will not
display nginx version

Guess you like

Origin blog.csdn.net/weixin_34161083/article/details/90914308