Feature request: retry-on/redispatch

Hello,

we ran into a use case which i was unable to setup correctly in haproxy so maby this will result in a feature request. or maby i just did/understand it would like to hear ur thoughts.

we have an S3 endpoint where images are served from.
we have an php script. in case the image is not found on S3 then one should be generated by the php script. so i desire the following.

haproxy → S3 If 403/404 then rewrite/route the request to my img.php.

so my desire is something like if the backend server returns a 403/404 then Reroute the request to Another backend(not another server within the same backend) where my nginx+php runs

i have 3 S3 endpoints and i have 3 nginx+php endpoint.

Since i was unable to pull this off i currently did the following workaround.

haproxy → nginx → S3 if 403/404 then rewrite/route the request to my img.php.

let me know what you all think of this.

Use retry-on