Nginx ways to hide all kinds of information on the server side _nginx

Source: Internet
Author: User

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

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.