If possible I would like to use a keep-alive connection timeout less than that of the backend servers to avoid premature connection close by backend server. As mentioned before, I am trying to avoid other options like rerouting using proxy_next_upstream or retrying by downstream client.
Is there a way to set a timeout on keep-alive connections to backend servers? Or even force close or invalidate the connection cache from code?