Hiding server information makes the server more secure. hiding nginx version numbers in the response header hides php information. This section describes how to hide nginx response header information and php response header information. First, hide the nginx version information. you only need to edit the nginx. conf file and add a server_tokensoff; http {& nbsp; & n
Hiding server information makes the server more secure. hiding nginx version numbers in the response header hides php information. This section describes how to hide nginx response header information and php response header information.
First, you only need to edit the nginx. conf file to hide the nginx version information.
Add a row
Server_tokens off;
http {
????
include??????
/etc/nginx/mime
.types;
????
default_type? application
/octet-stream
;
????
index index.php index.html index.htm;
????
server_tokens off;
????
log_format? main?
'$remote_addr - $remote_user [$time_local] "$request" '
??????????????????????
'$status $body_bytes_sent "$http_referer" '
??????????????????????
'"$http_user_agent" "$http_x_forwarded_for"'
;
????
access_log?
/var/log/nginx/access
.log? main;
????
sendfile??????? on;
????
#tcp_nopush???? on;
????
keepalive_timeout? 65;
????
#gzip? on;
????
include
/etc/nginx/conf
.d/*.conf;
}
The response header hides the rest of the PHP version. edit the php. ini file to find expose_php = On and change it? Expose_php = Off
;;;;;;;;;;;;;;;;;
; Miscellaneous;
;;;;;;;;;;;;;;;;;
; Decides whether PHP may expose the fact that it is installed on the server
; (E.g. by adding its signature to the Web server header ).? It is no security
; Threat in any way, but it makes it possible to determine whether you use PHP
; On your server or not.
Http://www.php.net/manual/en/ini.core.php#ini.expose-php
Expose_php = Off