Nginx optimization of Web optimization [hide Web name and version number]

Source: Internet
Author: User

Nginx optimization of Web optimization [hide Web name and version number]

    1. Hide Web name and version number

1) Information disclosure:

      • Display information when error occurs;

      • Curl Displays information;

[Email protected] ~]# curl-i http://www.etiantian.org/sd http/1.1 404 Not FOUND server:nginx/1.2.9 #未隐藏版本号 date:wed, Oct 15:57:08 GMT content-type:text/html connection:keep-alive vary:accept- Encoding

2) Workaround:

                [[email  protected] nginx-1.6.2]# sed -n  ' 13,17p '  src/core/nginx.h

#define Nginx_version "2.4.2" #define Nginx_ver "nginx/" nginx_version #define NGINX_VAR "old Boy_server "#define Ngx_oldpid_ext". Oldbin "


[[email protected] application]# Find/-type f-name "ngx_http_special_response.c"
/server/tools/nginx-1.6.3/src/http/ngx_http_special_response.c


[Email protected] nginx-1.6.2]# sed-n 49p src/http/ngx_http_header_filter_module.c

static char ngx_http_server_string[] = "Server:oldboy_server" CRLF;

[Email protected] nginx-1.6.2]# sed-n ' 21,29p ' src/http/ngx_http_special_response.c

Static U_char ngx_http_error_full_tail[] = "
Static U_char ngx_http_error_tail[] = "



This article is from the "Lanzhi" blog, make sure to keep this source http://7826443.blog.51cto.com/7816443/1705060

Nginx optimization of Web optimization [hide Web name and version number]

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.