I've been reading through HAProxy's documentation, and I could not seem to find a way to route HTTP requests based on the source IP address. That is, I want to route specific sources to specific backend servers. For example, I want to route any request that's coming from 10.1.0.3 to one specific server.
You can use ACL for this king of settings.
Example:
acl sub1 src 192.168.0.0/24
acl sub2 src 192.168.1.0/24
use backend back1 if sub1
use backend back2 if sub2
Then you have to declare both backend server back1 and back2
I hope this help. Regards,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With