Dear HAProxy list,
I have a question regarding ACL logic.
First of all some background to my predicament:
recently we switched to different API and WWW slices. Usually, updated
clients will call api.somewhere for API and www.somewhere for WWW. This
holds true for 90% of the cases. A number (let's say 10%) have not updated
their clients yet and they use the old scheme somewhere/api/etc to access
the API. I am trying to provide a hotfix for that using HAProxy. Here is my
relevant configuration which does NOT work:

    acl is_api hdr_beg(host) -i api or path_beg -i api
    acl is_www hdr_dom(host) -i www.somewhere
    use_backend api if is_api
    use_backend www if is_www
    use_backend www if !is_api

the problem is that when I curl www.somewhere/api/etc, HAProxy will use the
is_www ACL, resulting in a 404 (and a non-working client for the minority
of the users).

Any input on how can I fix that would be more than welcome :)

Reply via email to