using rsprep to change response status affects other ACL's

From: Jeremy Hinegardner <jeremy#hinegardner.org>
Date: Fri, 9 Jul 2010 15:55:53 -0600


I just want to make sure that this is the expected behavior:

    [root#tt3 ~]# haproxy -v
    HA-Proxy version 1.4.8 2010/06/16

And the snippet of a config showing the behavior. If the response from the server is a 404, we want to change the status to 555. If the status is 555 add a Location header:

    frontend main *:80

        default_backend site1

    backend site1

        acl not_found               status 404
        acl bizzare_status          status 555

        rspadd  X-Wibble:\ bizzare                          if bizzare_status
        rspadd  X-Wibble:\ not_found                        if not_found

        rsprep ^HTTP/1.1\ 404\ (.*)$ HTTP/1.1\ 555\ Bizzare if not_found


        server      site1 127.0.0.1:81 check

Curl session against a haproxy with the above config:

    % curl --verbose --silent http://tt3/foo.html > /dev/null

What this appears to show, is that both of the status based ACL's are satisfied at different times. That is, it appears that the following happens:

I'm okay with this, and can work with it. I just want to make sure that this is the expected behavior.

enjoy,

-jeremy

--
========================================================================
 Jeremy Hinegardner                              jeremy#hinegardner.org
Received on 2010/07/09 23:55

This archive was generated by hypermail 2.2.0 : 2010/07/10 00:00 CEST