On Thu, Apr 08, 2010 at 02:54:01PM -0700, Brian Koloszyc wrote:
> So with something like this?
>
> frontend loadbalancer *:80
> acl bot_acl hdr(User-Agent) msnbot/2.0b

use hdr_beg() or hdr_sub() instead of hdr(). hdr() alone
matches the whole string. hdr_beg() will check the header
begins with the same string. hdr_sub() will check that the
header contains the string.

Also you may want to add "-i" to ignore case when matching
strings :

  acl bot_acl hdr_beg(User-Agent) -i msnbot/2.0b

(...)
> Can you add multiple acls on the frontend?  For example:

yes.

> frontend loadbalancer *:80
> acl bot_acl hdr(User-Agent) msnbot/2.0b
> acl bot_acl hdr(User-Agent) Baiduspider+
> acl bot_acl hdr(User-Agent) Googlebot/2.1

You can even use multiple patterns on one line, which will speed up the
test, because all of them will be checked for each header while in your
case, the header lookup will have to be performed for each value :

 acl bot_acl hdr_beg(User-Agent) -i msnbot/2.0b  Baiduspider+  Googlebot/2.1

But I see that you got it, so as of now you're able to do whatever you
want with that :-)

Regards,
Willy


Reply via email to