Linux · 2012-07-06

Varnish删除http header相关信息

varnish删除http header相关信息

sub vcl_deliver {
remove resp.http.X-Varnish;
remove resp.http.Via;
remove resp.http.Age;
remove resp.http.X-Powered-By;
}

未删除前

  HTTP/1.1 200 OK
  Server: Apache/2
  X-Powered-By: PHP/5.2.17
  Vary: Accept-Encoding,User-Agent
  Content-Type: text/html; charset=UTF-8
  Date: Thu, 05 Jul 2012 07:56:45 GMT
  X-Varnish: 491720666
  Age: 0
  Via: 1.1 varnish
  Connection: keep-alive
Length: unspecified [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

删除后

  HTTP/1.1 200 OK
  Server: Apache/2
  Vary: Accept-Encoding,User-Agent
  Content-Type: text/html; charset=UTF-8
  Date: Thu, 05 Jul 2012 09:03:28 GMT
  Connection: keep-alive
Length: unspecified [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.