Hello! The following patch series introduces a couple of improvements to handling of HTTP error responses got from upstream servers:
1. If an error is listed in proxy_next_upstream (and friends), such as with "proxy_next_upstream http_502", balancer is now informed about the failure even if we weren't able to switch to the next upstream server due to additional restriction (such as number of tries or non-idempotent request). Notably, this fixes gRPC proxying with "grpc_next_upstream http_502", which previously never switched of a server which only returned 502 errors. 2. If an error is listed in proxy_next_upstream (and friends) and considered to be a failure, and there is a stale cached response with "Cache-Control: stale-if-error=...", such a response will be sent to the client, much like it happens with network errors. See relevant patches for more details. Review and testing appreciated. -- Maxim Dounin
