Skip to content

Nginx Configuration Essentials Textbook

A free, self-paced textbook in 8 chapters. Read a chapter, then drill it with the 120 companion flashcards using spaced repetition.

8 chapters · 120 cards · Updated

Chapters

  1. 1Nginx Fundamentals and Process Model

    Nginx — pronounced "engine x" — is a high-performance open-source HTTP server, reverse proxy, and IMAP/POP3 mail proxy originally written by Igor Sysoev and first released in 2004....

  2. 2Core Configuration Directives and Performance Knobs

    At the top level the configuration file lives in the main context, and from there directives branch into several nested blocks. The most important ones are http {} for HTTP-wide se...

  3. 3HTTP Routing: Servers, Locations, and Rewrites

    The server {} block is nginx's virtual host. The server_name directive declares which hostnames the block responds to and supports exact names, leading wildcards (\*.example.com),...

  4. 4Reverse Proxying, Upstreams, and Backend Protocols

    An upstream {} block defines a named group of backend servers that nginx will load-balance across. A typical example declares several server entries, optional weights, and a keepal...

  5. 5Caching and Compression

    Caching in nginx is configured in two steps: declare a cache zone on disk, then opt in from a location. The proxy_cache_path directive creates a managed cache directory tree with m...

  6. 6TLS, SSL, and Connection Hardening

    TLS is mandatory for any production site. The minimum directives to enable it on a server block are listen 443 ssl http2;, ssl_certificate pointing at the PEM file, ssl_certificate...

  7. 7Access Control, Rate Limiting, and Logging

    Access control in nginx starts with the simple allow and deny directives, which act as an ACL matched against the client IP. A typical block permits an internal subnet and rejects...

  8. 8Advanced Routing, Variables, and Security Headers

    Some patterns require more than straightforward location matching. For single-page applications using HTML5 history-mode routing, every request should fall through to the applicati...

← Back to the Nginx Configuration Essentials deck