Good overview of reverse proxy, LB, and caching in one place. In production the failure mode we keep seeing is treating proxy_next_upstream as a free retry: without limiting non-idempotent methods you can double-POST on a slow 504. Pair next_upstream with a tight proxy_read_timeout, only retry safe methods, and keep max_fails/fail_timeout honest so a half-dead peer leaves the pool instead of collecting every retry.
For caching, start with a tiny proxy_cache zone and explicit bypass on anything that sets cookies; microcaching HTML for one to two seconds often buys more than a large stale zone that serves yesterday's auth header. After a rolling restart, watch 502 rate and upstream response time together — spikes usually mean health checks still pointed at draining workers while the cache kept sending traffic their way.
Good overview of reverse proxy, LB, and caching in one place. In production the failure mode we keep seeing is treating proxy_next_upstream as a free retry: without limiting non-idempotent methods you can double-POST on a slow 504. Pair next_upstream with a tight proxy_read_timeout, only retry safe methods, and keep max_fails/fail_timeout honest so a half-dead peer leaves the pool instead of collecting every retry.
For caching, start with a tiny proxy_cache zone and explicit bypass on anything that sets cookies; microcaching HTML for one to two seconds often buys more than a large stale zone that serves yesterday's auth header. After a rolling restart, watch 502 rate and upstream response time together — spikes usually mean health checks still pointed at draining workers while the cache kept sending traffic their way.