1, Nginx hidden Head version information method
Edit the nginx.conf configuration file and add the following line within http{}
Copy Code code as follows:
HTTP {
......
Server_tokens off;
......
}
Edit PHP-FPM configuration file, fastcgi.conf or fcgi.conf
Found it:
Copy Code code as follows:
Fastcgi_param server_software nginx/$nginx _version;
To
Copy Code code as follows:
Fastcgi_param Server_software Nginx;
Restart Nginx service in effect
Copy Code code as follows:
[Root@xmydlinux conf]# Curl--head 127.0.0.1
http/1.1 OK
Server:nginx
content-type:text/html; Charset=utf-8
Connection:keep-alive
............
2, Apache hidden head version information
Edit httpd.conf File
Found it:
Copy Code code as follows:
Servertokens OS
Serversignature on
Modified to:
Copy Code code as follows:
Servertokens productonly
Serversignature off
Restarting the HTTPD service takes effect
Copy Code code as follows:
[Root@xmydlinux ~]# curl-i 127.0.0.1
http/1.1 OK
Server:apache
Accept-ranges:bytes
content-length:97
Connection:close
Content-type:text/html
Another: Can change the source code include directory ap_release.h this file
Copy Code code as follows:
#define Ap_server_basevendor "Apache Software Foundation" #apache相关字样都可更改
#define Ap_server_baseproject "Apache HTTP SERVER"
#define AP_SERVER_BASEPRODUCT "Apache"
#define Ap_server_majorversion_number 2 #版本字段可随意更改
#define Ap_server_minorversion_number 2
#define Ap_server_patchlevel_number 17
#define Ap_server_devbuild_boolean 0
3, PHP version of the head file hidden return
modifying php.ini files
Found it:
Copy Code code as follows:
Modified to:
Copy Code code as follows:
The
can avoid returning the word "x-powered-by:php/5.2.17" in HTTP header information ...