HAProxy community

Reserve backend server

I have this configuration that balances three squid proxies:
backend squid_pool
balance source
mode tcp
server px1 x.x.x.1:3128 check port 8181 send-proxy inter 2000 rise 2 fall 3
server px2 x.x.x.2:3128 check port 8181 send-proxy inter 2000 rise 2 fall 3
server px3 x.x.x.3:3128 check port 8181 send-proxy inter 2000 rise 2 fall 3

Now I want to change it so that the px3 server remains as reserve in case of failure of px1 or px2 and then, when the fallen server becomes available again (px1 or px2), that the connections return to the server that was back online and that the reserve server returns to be as reserve.
How should I achieve this configuration?
Thank you very much for your help.

Gabriel

Okay, this information is useful. But it doesn’t fully answer my question.
I want that in case any of my servers fails, the traffic is redirected to the backup server.
The post you sent me talks about the case that all the servers fail and the traffic is redirected to the backup server.
I need that if any of my two servers fail their respective traffic goes to the backup and then return to normal when the server falls back online.
I thank you in advance for any help in this regard.
cordial greetings
Gabriel