This is a invalid configuration. If the configurations parsers allows it, then the parser should be improved.
You can load balance between different servers, you can’t load-balance between paths directly.
What you you expect exactly from this configuration? That the URI is always statically rewritten to /rr_path_1 or /rr_path_2 without any consideration for what the client send?
I can think of a way to do this in haproxy, but it’s certainly not “nice”:
you could just load-balance between the actual servers
in addition to that, you could probably randomly rewrite the URI to either /rr_path_1 or /rr_path_2 (with rand(), ACLs and rewrite statements.
So in the end, you’d rewrite the destination URI randomly between the 2 paths, while also load-balancing between the two actually servers, which is probably what you want.
“What you you expect exactly from this configuration? That the URI is always statically rewritten to /rr_path_1 or /rr_path_2 without any consideration for what the client send?”
yes
“So in the end, you’d rewrite the destination URI randomly between the 2 paths, while also load-balancing between the two actually servers, which is probably what you want.”
how would be the backend block syntax using this rand ?
are there just 2 rr_path as mentioned or are they more in reality?
I’m just seeing that you configured cookies as well. Do you need stickiness as well? Between the paths also? Because that will certainly not work, even if we figure out the exact syntax to make my proposal work.
mmm… i have to ask to developer about that sticket if need to balance. and yes we have for now 3paths … the example here was with 2 to give you an idea
othe other thing I did was read the doc about rand() function and i saw rand(2) is starting from 0,1,2 (means i need to set my path using 0 i guess) or without 0 because phisically we have path_rr1,2,3 and not path_rr,1,2 or path_rr0,1,2 to use with rand …
i send generic rr_path and the logs show randon function ok… but not works
in fact not using this mechanism… and setting like before using this. is the same url like logs but hit the site ok
on frontend old config
acl web path_beg -i /path1
acl web path_beg -i /path2
acl web path_beg -i /path3
use_backend web_rr_be if dom_example web
on backend
backend web_rr_be
mode http
balance roundrobin
option httpchk
server web1 1.2.3.4:80 check inter 5s weight 50 id 1
server web2 1.2.3.5:80 check inter 5s weight 50 id 2
I don’t know what your backend server needs, I just provided a configuration that does what you requested.
Test against your backend server directly, without haproxy involved, once you know what your backend server wants, you will know how to configure haproxy.