Re: [squid-users] helpers...

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 27 Aug 2008 01:33:13 +1200

John Doe wrote:
> Hi,
>
> I am trying to do the following:
>
> only if referer=external then run the external_acl helper
> then, run the url_rewrite helper in any case
>
> This seems to work:
>
> external_acl_type filter %PATH /path/to/filter
> acl filter external filter
> acl our_referer referer_regex oursite.com
> http_access allow !our_referer filter
>
> url_rewrite_program /path/to/rewrite
> ...
> url_rewrite_access allow all
>
> Is it ok or is there a better way?

Thats pretty much it. Though you don't have any control over whether
http_access gets checked before or after url_rewrite. Fortunately ACLs
for http_access usually work on the raw input data.

>
> Also, is there a way to pass 2 variables to the external_acl helper; like "%PATH %{Hdr:Referer}"?

Yes:
  external_acl_type filter %PATH %{Referer} /path/to/filter

Amos

-- 
Please use Squid 2.7.STABLE4 or 3.0.STABLE8
Received on Tue Aug 26 2008 - 13:33:25 MDT

This archive was generated by hypermail 2.2.0 : Tue Aug 26 2008 - 12:00:04 MDT