HTTP proxy directives

proxy_cache_use_stale directive

HTTP, server, location context. Default: off. Introduced: version-specific parameters. Selects failure/update cases for serving an expired entry; no strict age cap.

Formal Syntax & Structure

nginx syntaxnginx
proxy_cache_use_stale error | timeout | invalid_header | updating | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429 | off ...;

Parameters & Attributes

NameTypeDescription
conditionerror | timeout | invalid_header | updating | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429 | off (repeatable)Choose failure or refresh conditions permitting expired content. Never rely on stale private responses.

Working Example

Example Snippetnginx
proxy_cache_use_stale error timeout http_503;
Nginx Reference