Sometimes we do not want someone to use some tools to return to our server information, I would like to introduce in the Nginx hide Nginx response header, modify Nginx return header information, hide PHP version number, hide server information, students can refer to.
Hide Nginx version information First, just edit nginx.conf file
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 "
c9/> ' "$http _user_agent" "$http _x_forwarded_for";
Access_log/var/log/nginx/access.log main;
Sendfile on ;
#tcp_nopush on ;
Keepalive_timeout;
#gzip on;
include/etc/nginx/conf.d/*.conf;
}
Response Head Hide PHP version rest, edit php.ini file Find expose_php = On, modify to expose_php = Off
;;;;;;;;;;;;;;;;;
; miscellaneous;;;;;;;;;;;;;
Decides whether PHP may expose the fact, it is installed on the server
; (e.g. by adding it signature to the WEB server header). It is no security
; threat in any way, but it makes it possible to determine whether your use PHP
. On your server Or not.
; http://www.php.net/manual/en/ini.core.php#ini.expose-php
expose_php = Off