On 5/11/21 4:15 PM, Tom wrote:
Using haproxy 2.1.3:
I've configured multiple conditions to a "use_backend" directive like this:

use_backend example_192.168.1.30 if host_test.example.com || host_a01.test.example.com || host_a02.test.example.com || host_a03.test.example.com || host_a04.test.example.com || ... || ...

When I add some more conditions, then I got an error after reloading the daemon:

"line too long, truncating at word 65, position 783:..."

I'm also interested in technical reason for this limitation :), waiting for smarter people to speak ;)


How can I configure more conditions in the "use_backend"-directive above without having the error?

Maybe you can use named acl, repeat it multiple times:

"With named ACLs, specifying the same ACL name multiple times will cause a logical OR of the conditions, so the last block can also be expressed as:

acl evil path_beg /evil/
acl evil path_end /evil
http-request deny if evil
"

Example from our blog post:

https://www.haproxy.com/blog/introduction-to-haproxy-acls/

Best regards,
--
Adis Nezirovic
Software Engineer
HAProxy Technologies - Powering your uptime!
375 Totten Pond Road, Suite 302 | Waltham, MA 02451, US
+1 (844) 222-4340 | https://www.haproxy.com

Reply via email to