DevOps
Nginx
A fast, event-driven web server and reverse proxy that handles static files, TLS termination, load balancing, caching and gzip with a small footprint. It commonly fronts application servers to absorb connections and offload work. Its power is its configuration, which is also the flip side: config is easy to get subtly wrong.
Purpose
Nginx is a high-performance web server and reverse proxy built on an event-driven model that handles enormous connection counts with little memory. It typically stands in front of application servers, serving static files directly and forwarding dynamic requests upstream.
When to Use It
The classic front door: TLS termination, gzip/brotli compression, static asset serving with cache headers, load balancing across app instances, and buffering slow clients so application workers stay free. It is also a common Kubernetes ingress controller.
Trade-offs
Its power lives in its configuration — and so do its bugs: location matching, proxy headers and redirect rules are easy to get subtly wrong. Alternatives trade convenience differently: Caddy automates TLS with simpler config; HAProxy specialises in load balancing.
Implementation
Define server blocks per site and location blocks per path; proxy_pass to upstreams and always forward the real client details (Host, X-Forwarded-For, X-Forwarded-Proto). Terminate TLS with modern ciphers, enable HTTP/2, set sane timeouts and body-size limits, and test every change with nginx -t before reload.