nginx隱藏http頭

 修改src/core/nginx.hhtml

#define NGINX_VERSION "1.0.12"java

#define NGINX_VER "nginx/" NGINX_VERSIONnode

#define NGINX_VAR "NGINX"nginx

修改src/http/ngx_http_header_filter_module.capache

static char ngx_http_server_string[]="Server: nginx" CRLF;app

修改src/http/ngx_http_special_response.ctcp

static u_char ngx_http_error_tail[]="<hr><center>nginx</center>" CRLF"</body>" CRLF"</html>" CRLF;ide

vi nginx.conf
在http 加上 server_tokens off;ui

以下:component

http {
……省略配置
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
tcp_nodelay on;
server_tokens off; 
…….省略配置
}

 

Squid 3.0 STABLE 11 
src/globals.cc:58 改成:
const char *const full_appname_string = "jufukeji";
輸出 Header:
HTTP/1.0 400 Bad Request
Server: jufukeji
Mime-Version: 1.0
Date: Mon, 12 Jan 2009 15:25:15 GMT
Content-Type: text/html
Content-Length: 1553
Expires: Mon, 12 Jan 2009 15:25:15 GMT
X-Squid-Error: ERR_INVALID_URL 0
X-Cache: MISS from 'cache.hutuworm.org'
Via: 1.0 'cache.hutuworm.org' (jufukeji)
Proxy-Connection: close

 

Tomcat 6.0.18 
java/org/apache/coyote/http11/Constants.java:56

java/org/apache/coyote/ajp/Constants.java:236

均改成:ByteChunk.convertToBytes("Server: jufukeji" + CRLF);
輸出 Header:
HTTP/1.1 200 OK
Server: jufukeji
ETag: W/"7857-1216684872000"
Last-Modified: Tue, 22 Jul 2008 00:01:12 GMT
Content-Type: text/html
Content-Length: 7857
Date: Mon, 12 Jan 2009 16:30:44 GMT

 

Apache 2.2.11  server/core.c:2784 添加: ap_add_version_component(pconf, "jufukeji"); return; 輸出 Header: HTTP/1.1 200 OK Date: Mon, 12 Jan 2009 14:28:10 GMT Server: jufukeji Last-Modified: Sat, 20 Nov 2004 20:16:24 GMT ETag: "1920edd-2c-3e9564c23b600" Accept-Ranges: bytes Content-Length: 44 Content-Type: text/html

相關文章
相關標籤/搜索