http purge help

Stig Sandbeck Mathisen ssm at linpro.no
Tue Feb 19 06:55:40 CET 2008


Charlie Farinella <cfarinella at appropriatesolutions.com> writes:

> We have our vcl.conf configured like this:

You need something in your vcl_recv as well, to match against the
purge acl, and force it to "lookup" on an acl match.  It would go
nicely inside the "pipe if not GET or HEAD request" from the default
vcl like this:

sub vcl_recv {
  # [...]

  if (req.request != "GET" && req.request != "HEAD") {
    if (req.request == "PURGE") {
      if (!client.ip ~ purge) {
        error 405 "Not allowed.";
      }
      lookup;
    }
    set req.http.connection = "close";
    pipe;
  }

  # [...]
}

-- 
Stig Sandbeck Mathisen, Linpro



More information about the varnish-misc mailing list