infrastructure
Nginx Errors
Nginx errors: 502 Bad Gateway (upstream connect failed), 504 Gateway Timeout (upstream read timeout), 413 Request Entity Too Large, 'too many open files', 'upstream prematurely closed'.
Nginx 502/504 distinction: 502 = upstream connect failed (TCP/socket level), 504 = upstream took too long to respond. Tune `proxy_connect_timeout`, `proxy_read_timeout`, `proxy_send_timeout`. 413 needs `client_max_body_size`. 'too many open files' = bump worker_rlimit_nofile and OS ulimit. Always check `error.log` with the request_id from access.log.
Official docs
https://nginx.org/en/docs/
Support
https://nginx.org/en/support.html