HA Proxy ACL for URL matching dynamically

Hi souvikbhattacharyas -

Yes, such a configuration is possible. You probably want to investigate map files in the configuration, and ACLs: https://cbonte.github.io/haproxy-dconv/configuration-1.6.html#7

Specifically a configuration like:

acl known_company path -i -m beg -M -f /etc/haproxy/known_backends.lst
use_backend %[path,map_beg(/etc/haproxy/known_backends.lst)] if known_company
default_backend some_other_backend

…might do the trick (I haven’t checked that for accuracy, but that’s the idea).

Hope that helps!

  • Andrew