0

Imagine we have a backend file like this :

test.com backend_1
test.com backend_2

and we have something like this in our haproxy config file

frontend http_front
   bind *:80
   stats uri /haproxy?stats
   use_backend %[str(test.com),map(/etc/haproxy/testmap.map,default)]

this config is working but always return backend_1 when u reach to test.com

i want it to round-robin the requests to 2 backends with this mapfile

1 Answers1

0

There is a balance section to the backend configuration. You can see it in the docs here: https://www.haproxy.com/blog/the-four-essential-sections-of-an-haproxy-configuration/#balance

The backend file would look something like this:

backend test_com
  balance roundrobin
  server backend_1 10.0.1.3:80 
  server backend_2 10.0.1.4:80
nicgrayson
  • 21
  • 2