As an aside, should the documentation extract below actually read:

        acl local_dst    hdr(Host) -i localhost
                             ^
                             ^
i.e. is the name of the header case sensitive? In my attempts to work this
out I think that I had to use 'Host' rather than 'host' before it worked.


4.2. Alphabetically sorted keywords reference
---------------------------------------------

This section provides a description of each keyword and its usage.


acl <aclname> <criterion> [flags] [operator] <value> ...
  Declare or complete an access list.
  May be used in sections :   defaults | frontend | listen | backend
                                 no    |    yes   |   yes  |   yes
  Example:
        acl invalid_src  src          0.0.0.0/7 224.0.0.0/3
        acl invalid_src  src_port     0:1023
        acl local_dst    hdr(host) -i localhost

  See section 7 about ACL usage.


-----Original Message-----
From: Andrew Commons [mailto:andrew.comm...@bigpond.com] 
Sent: Wednesday, 28 April 2010 4:06 PM
To: 'haproxy@formilux.org'
Subject: Matching URLs at layer 7

I'm confused over the behaviour of the url criteria in layer 7 acls. 

If I have a definition of the form:

        acl xxx_host     hdr(Host)      -i xxx.example.com

then something like this works fine:

        use_backend xxx         if xxx_host

If I try something like this:

        acl xxx_url      url_beg        -i http://xxx.example.com
        use_backend xxx         if xxx_url

then it fails.

I've tried:

        acl xxx_url      url_sub        -i xxx.example.com
        acl xxx_url      url_dom        -i xxx.example.com

Same result....I'm missing something obvious here, I just can't see it :-(

My ultimate goal is to have:

        use_backend xxx         if xxx_url xxx_host

which I think makes sense for a browser request that has not been fiddled
with...if I could test it I would be able to find out!

Any insights appreciated :-)

Cheers
andrew


Reply via email to