For one of our services we need to mask some server errors and return
empty results instead. Currently we have done this by the following
rule:
rspdeny . if { status gt 200 }
However, we need to do this only for some URLs (let's say urls that
contain "type=1"), and this attempt fails:
acl needs-rewrite url_sub type=1
rspdeny . if { status gt 200 } needs-rewrite
[WARNING] 050/130922 (8048) : parsing [haproxy.cfg:156] : acl
'needs-rewrite' involves some volatile request-only criteria which
will be ignored.
So the URL is not available for rspdeny filtering, but the URL is
still stored somewhere since it will be logged, so maybe this can be
changed?
We ended up with this:
acl needs-rewrite url_sub type=1
use_backend rewriting if needs-rewrite ...
use_backend normal if ....
...
backend rewriting:
rspdeny . if { status gt 200 }
server A ..
backend normal:
server A ..
Now the problem is that we define the server in multiple backends, and
we can no longer set a reasonable maxconn on the servers.
- Finn Arne