Search code examples
proxyhaproxy

haproxy match various conditions in use_backend


I'm trying to match various conditions inside one backend, like this:

acl rule1 hdr_dom(host) -i ext1
acl rule2 utl_beg /img
default_backend back-server-http if rule1 and rule2

but, how can I put this "and" between the two rules?


Solution

  • Yes, this is the solution:

    acl rule1  hdr_dom(host) -i www.uno.es  hdr_dom(host) -i www.one.com
    use_backend uno.com if rule1