隐藏nginx,apache,tomcat,varnish版本信息
1.隐藏nginx的版本号和server信息# vim src/http/ngx_http_special_response.c
static u_char ngx_http_error_tail[] =
"tingyun" CRLF --修改定义的名字
"" CRLF
"" CRLF
# vim src/http/ngx_http_header_filter_module.c
static char ngx_http_server_string[] = "Server: tingyun" CRLF;
# vim src/core/nginx.h
#define NGINX_VERSION ""
#define NGINX_VER "tingyun/" NGINX_VERSION
#define NGINX_VAR "tingyun"
# ./configure --prefix=/usr/local/nginx-1.8.0 --user=www --group=www --with-poll_module --with-threads --with-file-aio --with-http_sub_module --with-pcre=/usr/local/pcre-8.37 --with-http_stub_status_module --编译
# make && make install
2.隐藏varnish的版本信息
# vim default.vcl --添加如下内容
sub vcl_deliver {
unset resp.http.Via; --默认是显示版本信息(unset 是取消显示)
unset resp.http.X-Varnish;
set resp.http.Server="no-server";--设置后端服务器版本信息(unset 就是取消)
}
# /etc/init.d/varnish restart
Stopping Varnish Cache:
Starting Varnish Cache:
#
页:
[1]