nginx with proxy_cache_use_stale not returning from cache when connection refused

new299 nginx-forum at
Thu Dec 11 03:00:25 UTC 2014

When the upstream goes away nginx gives the error "502 Bad Gateway
nginx/1.4.6 (Ubuntu)". The log contains:

" [error] 2624#0: *48941 connect() failed (111: Connection refused) while
connecting to upstream,"

Rather than serving it from cache as I would expect. It should be cached as
the page was previous returned successfully.

Posted at Nginx Forum:,255408,255414#msg-255414

More information about the nginx mailing list