Varnish删除http header相关信息

varnish删除http header相关信息

  1. sub vcl_deliver {
  2. remove resp.http.X-Varnish;
  3. remove resp.http.Via;
  4. remove resp.http.Age;
  5. remove resp.http.X-Powered-By;
  6. }

未删除前

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

删除后

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

3 Comments

  1. 这个方法我找了好久,哈哈。

  2. 小桥哥哥真是学无止境啊!
    来看哥哥了!