Is it possible to configure HAProxy to choose a backend server based on a request's source IP? If so, how?

Solution 1:

I would do this by creating separate backends, then then route them accordingly from the front end based on the source IP:

For instance:

frontend foo
   acl is_A src 192.168.100.1
   acl is_B src 192.168.100.1
   use_backend A if is_A
   use_backend B if is_B
backend A
   server blah
backend B
   server baz

You could also put a list of ips in a file and then source the file with something like acl is_A src -f /etc/haproxy/special_ips