隐藏nginx头部
修改后的src/core/nginx.h ,代码如下:
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGINX_H_INCLUDED_
#define _NGINX_H_INCLUDED_
#define nginx_version 1003008
#define NGINX_VERSION "1.3.8"
#define NGINX_VER "REKFAN/" NGINX_VERSION
#define NGINX_VAR "REKFAN"
#define NGX_OLDPID_EXT ".oldbin"
#endif /* _NGINX_H_INCLUDED_ */
编译Nginx,重新看看结果header信息还是没变!
最后找到另一个帖
子更改src/http/ngx_http_header_filter_module.c文件成功了!
找到下面两行:
static char ngx_http_server_string[] = "Server: nginx" CRLF;
static char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
将其修改为:
static char ngx_http_server_string[] = "Server: REKFAN" CRLF;
static char ngx_http_server_full_string[] = "Server: REKFAN/1.0" CRLF;