HTTP proxy directives

proxy_next_upstream directive (HTTP proxy)

HTTP, server, location contexts. Selected common syntax; default error timeout. Additional commercial denied parameter is version-specific. Retry is constrained by request replayability and downstream progress; avoid non_idempotent opt-in for ordinary writes.

Formal Syntax & Structure

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

Parameters & Attributes

NameTypeDescription
conditionserror | timeout | invalid_header | http_500 | http_502 | http_503 | http_504 | http_403 | http_404 | http_429 | non_idempotent | off (repeatable)Baseline retry conditions; denied is commercial from 1.29.3. Replaying writes needs explicit application safety.

Working Example

Example Snippetnginx
proxy_next_upstream error timeout;
Nginx Reference