Haproxy retries using option redispatch

Hi , I’m looking for some help in getting information where I want to understand the option redispatch’s reach on retries. Can I retry my requests on specific errors e.g. including some timeout responses received from my backend server

e.g. haproxy sends request to S1 ( S1 processes the request and realizes its taking so much time in processing and terminates the request with specific error code in HTTP response 503,504 even 500

If I want to retry the request on S2 then S3 which have failed with 500 e.g. for 3retries on round robin basis before abandoning it. Is it possible to configure?


Retries and redispatch works when a TCP connection to the server could not be established, once the request is send, it cannot be replayed towards another server.

Thank you for getting this clarified.