Hi Lukas, Thanks for the reply and willingness to help.
I did a test and it didn't work. I dropped the server2 interface and only server1 was UP. Traffic continues to exit through the main bakend. My wish is that the traffic is directed to the backup server. Any tips? Thank you very much. Em sáb., 19 de fev. de 2022 às 10:48, Lukas Tribus <[email protected]> escreveu: > Hello, > > I suggest you put your backup server in a dedicated backend and select > it in the frontend. I guess the same could be done with use-server in > a single backend, but I feel like this is cleaner: > > > > frontend haproxy > option forwardfor > bind server.lab.local:9191 > use_backend backup_servers if { nbsrv(backend_servers) lt 2 } > default_backend backend_servers > > backend backend_servers > server server1 192.168.239.151:9090 check > server server2 192.168.239.152:9090 check > > backend backup_servers > server serverBKP 192.168.17.2:9090 backup > > > > Lukas > > On Sat, 19 Feb 2022 at 14:17, Carlos Renato <[email protected]> wrote: > > > > Can anyone help me? > > > > How to create an ACL to use the backup server if a server goes DOWN. So, > if the two backend servers are UP, I use the registered servers. If one > (only one) becomes unavailable, traffic is directed to the backup server. > > > > Below my settings. > > > > frontend haproxy > > option forwardfor > > bind server.lab.local:9191 > > default_backend backend_servers > > > > backend backend_servers > > server server1 192.168.239.151:9090 check > > server server2 192.168.239.152:9090 check > > server serverBKP 192.168.17.2:9090 backup > > > > Thank you for your help > > > > > > > > > > -- > > > > > --

