Please help me out,
We're using HAProxy (my-proxy.com
) and on the backend side, we have two endpoints
- backend1:4000/foo/abc
- backend2:4000/bar/def
Now, when a client makes a request to my-proxy.com
, we want to route that request to one of the servers in a round-robin fashion while keeping the query intact. For example:
my-proxy.com?query1=abcd&query2=123 ==> `backend1:4000/foo/abc?query1=abcd&query2=123
my-proxy.com?query1=abcd&query2=123 ==> `backend2:4000/bar/def?query1=abcd&query2=123
We have the following setting and it's not working:
frontend localhost
bind *:80
bind *:443 ssl crt /etc/ssl/tls.pem
mode http
default_backend my_backend
backend my_backend
mode http
timeout server 5s
balance roundrobin
server s01 backend1:4000/foo/abc check
server s02 backend2:4000/bar/def check
Is there any way to achieve this setting? Please point me in the right direction, thanks!