Which nginx directives matter most for a production reverse proxy?
IntermediateProductionLoad Balancing, Proxies & nginx in Production
Answer
worker_processes auto, worker_connections 4096, keepalive in upstream blocks plus proxy_http_version 1.1 and proxy_set_header Connection "", proxy_next_upstream limited to idempotent errors, sane proxy_*_timeout, client_max_body_size, gzip or brotli, access_log with $request_time and $upstream_response_time, and limit_req.
log_format main '$remote_addr "$request" $status $body_bytes_sent rt=$request_time urt=$upstream_response_time ua="$http_user_agent"';
More on Load Balancing, Proxies & nginx in Production
How do you choose between ALB, NLB and an nginx or Envoy fleet?IntermediateHow do you tune ALB idle timeout and backend keep-alive to avoid 502s?IntermediateHow do you do rate limiting and abuse protection in nginx?IntermediateHow do you achieve zero-downtime configuration reloads in nginx and HAProxy?IntermediateHow would you design a highly available load-balancing tier on-prem or in a colo?AdvancedHow do you perform a blue/green deployment at the load balancer level?Intermediate