Hides the nginx response header, modifies the nginx response header, hides the php version number, and hides the server information.

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.