help with purging

Ricardo Newbery ric at digitalmarbles.com
Thu Apr 17 20:53:37 CEST 2008


On Apr 17, 2008, at 11:08 AM, Pavel Pragin wrote:

> Hello,
>
> Please help me get Purging working. I am really stuck. I followed  
> the directions in this link:http://varnish.projects.linpro.no/wiki/VCLExamplePurging
>
> I added these lines to my VCL configuration file and restarted  
> Varnish:
> sub vcl_hit {
>         if (req.request == "PURGE") {
>                 set obj.ttl = 0s;
>                 error 200 "Purged.";
>         }
> }
>
> When I connect  to Apache on port 80 and send these command nothing  
> happens. I need a way to Purge on the fly!
>
> [root at 155496-app3 varnish]# telnet 67.192.43.99 80
> Trying 6.12.4.9...
> Connected to 6.12.4.9.
> Escape character is '^]'.
> PURGE / HTTP/1.1
> Host: www.bla.net
>
>
> Thanks
>


Did you add the other lines described in those directions?

By the way, it may be worth noting that if you have another proxy  
(like Apache) in front of Varnish, enabling PURGE requests could  
potentially allow unauthorized purges.  One way to fix this is to put  
Apache and Varnish on different IPs and make sure the Apache IP is not  
on the purge acl list.  Another fix is just to remove localhost from  
the acl list.  But in both cases then you have to send your purge  
requests straight to Varnish from an authorized IP and with a URL  
matching the form it would have coming from Apache.

Ric





More information about the varnish-misc mailing list