默认返回信息

debian:~/src/nginx-0.8.53/auto# curl -I 10.0.8.199

HTTP/1.1 200 OK

Server: nginx/0.8.53

Date: Sun, 28 Nov 2010 16:29:19 GMT

Content-Type: text/html

Content-Length: 152

Last-Modified: Sun, 28 Nov 2010 13:24:48 GMT

Connection: keep-alive

Accept-Ranges: bytes

修改两个地方

1、vim nginx.conf

在http区域添加

server_tokens off;

返回信息

debian:~/src/nginx-0.8.53/auto# curl -I 10.0.8.199

HTTP/1.1 200 OK

Server: nginx

Date: Sun, 28 Nov 2010 16:29:48 GMT

Content-Type: text/html

Content-Length: 152

Last-Modified: Sun, 28 Nov 2010 13:24:48 GMT

Connection: keep-alive

Accept-Ranges: bytes

2、修改nginx目录中conf目录下的fastcgi.conf

fastcgi_param  SERVER_SOFTWARE    
nginx/$nginx_version;

fastcgi_param  SERVER_SOFTWARE    nginx

可以在编译安装前更改源码,这样信息改的更彻底

编辑 vim ngx_http_header_filter_module.c 的 48 49 两行,改成自己需要的内容

static char ngx_http_server_string[] = “Server: nginx” CRLF;

49 static char ngx_http_server_full_string[] = “Server: ” NGINX_VER CRLF;

例如

static char ngx_http_server_string[] = “Server: zws” CRLF;

49 static char ngx_http_server_full_string[] = “Server: zws 1.0″  CRLF;