Nginx Learning
A practical NGINX learning path from server foundations to production architectures, traffic control, and debugging.
- Learning resources
- 81
- Beginner
- 16
- Advanced
- 34
- Total time
- 2725 min
Start here
1.1 The Web Server Landscape: Where NGINX Fits
Begin with the recommended resource, then continue through the learning stages in order.
Explore learning
All learning resources
Search, filter, and sort the complete learning collection for this technology.
81 resources
-
LearningnginxBeginner
1.1 The Web Server Landscape: Where NGINX Fits
Concept-heavy, hands-light. The hands arrive in 1.2 — this lesson builds the vocabulary.
~25 min read Open learning -
LearningnginxBeginner
1.2 Installing NGINX: Every Path That Matters
Hands-on: you will install (or at least deeply understand) four different installation paths and know when each is right.
~35 min read Open learning -
LearningnginxBeginner
1.3 Anatomy of an Installation
You will learn to read nginx -V like a radiologist reads an X-ray, and to locate every file an NGINX owns on any machine in 60 seconds.
~35 min read Open learning -
LearningnginxBeginner
1.4 The Architecture: Master, Workers, and the Event Loop
The most important conceptual lesson in the series. Everything from reload semantics to load-balancer behavior traces back to what you learn here.
~40 min read Open learning -
LearningnginxBeginner
1.5 Signals, Reloads, and Zero-Downtime
The operational climax of Module 1: how to command a live NGINX, and the exact anatomy of a zero-downtime reload — verified line by line against a running server.
~40 min read Open learning -
LearningnginxBeginner
2.1 The Configuration Language
The grammar of everything that follows. Short lesson, permanent payoff.
~30 min read Open learning -
LearningnginxBeginner
2.2 Server Blocks & Virtual Hosts
One IP, one port, many sites: the exact algorithm NGINX uses to pick a server{}, with every claim verified against a running server.
~35 min read Open learning -
LearningnginxBeginner
2.3 The Location-Matching Algorithm
The most quizzed, most misquoted mechanism in NGINX. After this lesson you will never guess again — you will trace.
~45 min read Open learning -
LearningnginxBeginner
2.4 Variables and map
Configuration that computes. NGINX has no if you should love (Lesson 11.2 explains why), but it has something better: variables with per-request values and map, the cleanest dispatch in town.
~35 min read Open learning -
LearningnginxBeginner
2.5 Directive Inheritance: The One Rule
"Why did my header disappear?" has exactly one answer, and after this lesson you'll never ask it again.
~40 min read Open learning -
LearningnginxBeginner
2.6 Includes, Organization, and nginx -T
The mechanics are done; now the engineering. Configs are programs, and programs need architecture, imports, and a debugger. NGINX ships all three.
~35 min read Open learning -
LearningnginxBeginner
3.1 root vs alias: The Filesystem Mapping, Settled
Two directives, one job: turn a URI into a file path. One appends, one replaces — and every confusion you've ever had reduces to that difference plus a trailing slash.
~35 min read Open learning -
LearningnginxBeginner
3.2 try_files: Fallbacks and the SPA Pattern
One directive that walks a list of candidate paths and picks the first that exists — and, in its last arm, jumps anywhere in your config. Small syntax, enormous leverage.
~35 min read Open learning -
LearningnginxBeginner
3.3 MIME Types, Charset, and Content Negotiation
One header decides whether the browser renders, downloads, or executes your bytes. NGINX decides it by extension — and hands you three levers to take control.
~30 min read Open learning -
LearningnginxBeginner
3.4 Serving Files Fast: sendfile, tcp_nopush, open_file_cache
The three directives everyone copies without reading. This lesson reads them — down to the syscalls — and tells you honestly when each one matters.
~35 min read Open learning -
LearningnginxBeginner
3.5 Error Pages, index, autoindex, and Redirects
The last 10% of a static site is what users remember when things go wrong. NGINX's finishing tools — and one Location-header behavior that surprises everyone once.
~35 min read Open learning -
LearningnginxIntermediate
4.1 proxy_pass Fundamentals: The URI Rules
One directive, four behaviors, one character that changes everything. This lesson settles the trailing-slash confusion permanently — with an echo backend as referee.
~40 min read Open learning -
LearningnginxIntermediate
4.2 The Header Contract: Making the Backend Whole
A proxied request arrives at your app wearing NGINX’s clothes. The headers you set — or forget — are the only way the app learns the truth: who asked, over what protocol, for what.
~40 min read Open learning -
LearningnginxIntermediate
4.3 Speaking Application: FastCGI, uWSGI, SCGI
The gateway pattern predates HTTP-everywhere: purpose-built wire protocols between web servers and app runtimes. NGINX speaks them natively — and the differences from proxy_pass are the lesson.
~40 min read Open learning -
LearningnginxIntermediate
4.4 WebSockets and Long-Lived Connections
HTTP's closure: a request ends, the connection may live. WebSockets invert the model — the connection IS the session — and your proxy must stop treating it like a request.
~30 min read Open learning -
LearningnginxIntermediate
4.5 gRPC: Proxying the Modern RPC
gRPC is HTTP that grew up: binary frames, streams, and trailers over HTTP/2. NGINX speaks it natively — but only if you give it HTTP/2 to speak it on.
~35 min read Open learning -
LearningnginxIntermediate
4.6 Gateway Behavior: Timeouts, Buffers, Failures, Bodies
A proxy is judged by its worst backend. This lesson is the toolkit that keeps one slow, one broken, and one greedy consumer from defining your service.
~40 min read Open learning -
LearningnginxIntermediate
5.1 The upstream Context: Pools and Round Robin
Names become infrastructure: one context block turns "an address" into "a pool with rules".
~35 min read Open learning -
LearningnginxIntermediate
5.2 Scheduling Algorithms: least_conn, hash, ip_hash, random
Round robin is fair to servers. These algorithms are fair to requests, to caches, and to sessions — three different definitions of fairness, three different directives.
~40 min read Open learning -
LearningnginxIntermediate
5.3 Failure Handling: Retries, Quarantine, and Backups
Every pool eventually serves through a failure. The difference between an incident and a log line is what you configured in this lesson — and NGINX’s defaults are smarter than they look.
~40 min read Open learning -
LearningnginxIntermediate
5.4 Connection Reuse: Upstream keepalive Pools
TCP handshakes are cheap until you count them. On a 10k rps edge, "new connection per request" is a hundred thousand handshakes per second someone has to pay for.
~30 min read Open learning -
LearningnginxIntermediate
5.5 Active Health Checks, Plus, and the Open-Source Road
Passive checks learn from traffic. Active checks *ask*. One of them is a product line — the other you can build yourself. A guru knows both, and knows when to pay.
~35 min read Open learning -
LearningnginxIntermediate
6.1 TLS Termination: Certificates and Handshakes
The edge's first job: turn encrypted client bytes into clean HTTP for your network — and do it without becoming the bottleneck or the weak link.
~40 min read Open learning -
LearningnginxIntermediate
6.2 Hardening: Protocols, Ciphers, and Headers
Security policy is a list of things you refuse. This lesson writes that list — then verifies the server actually enforces it, handshake by handshake.
~35 min read Open learning -
LearningnginxIntermediate
6.3 Mutual TLS: Client Certificates
TLS usually answers “is the server who it claims?” — mutual TLS adds “and is the client?” The strongest authentication on the internet, demonstrated end to end.
~40 min read Open learning -
LearningnginxIntermediate
6.4 Session Performance: Caches, Tickets, and Stapling
A full TLS 1.3 handshake is one round trip; TLS 1.2 is two. Multiply by every connection, and crypto becomes your latency line item — unless the parties remember each other.
~35 min read Open learning -
LearningnginxIntermediate
6.5 Access Control: auth_basic, allow/deny, and satisfy
The final gate before content: who may even ask? Three directives, one composition rule, and a phase-order trap that bites even veterans.
~35 min read Open learning -
LearningnginxIntermediate
7.1 geo and map: Building Routing Tables
Policy begins with classification: "who is this client?" turned into a variable you can route, gate, and log on.
~30 min read Open learning -
LearningnginxIntermediate
7.2 Rate Limiting: The Leaky Bucket, Measured
The most misunderstood trio in NGINX: rate, burst, nodelay. Watch the bucket queue requests at exact intervals — measured, not guessed — and count your own 429s.
~45 min read Open learning -
LearningnginxIntermediate
7.3 Connections and Bandwidth: limit_conn, limit_rate
Requests aren't the only thing clients spend. Some spend connections; some spend bytes. Two directives cap each — measured both ways, with receipts.
~30 min read Open learning -
LearningnginxIntermediate
7.4 Traffic Splitting: split_clients and the Two-Line Canary
"Show the new checkout to 10% of users."* — the requirement every product team eventually issues, and the directive almost nobody knows exists.
~30 min read Open learning -
LearningnginxIntermediate
7.5 WAF-Style Logic and Request Blocking
Not every request deserves a response. Some deserve a 403 before they cost you a single upstream millisecond — and a few deserve silence. Building that policy, with receipts.
~35 min read Open learning -
LearningnginxIntermediate
8.1 The Caching Mindset: Contracts Before Directives
Directives are easy; the thinking is the hard part. This lesson installs the three contracts every cache honors — identity, freshness, and validation — before the module’s directives arrive.
~30 min read Open learning -
LearningnginxIntermediate
8.2 proxy_cache: Keys and Storage
The machinery: where entries live, how they're found, and why the key you design decides everything else. Includes a live look inside the on-disk cache.
~40 min read Open learning -
LearningnginxIntermediate
8.3 TTLs, Cache Status, and Bypassing
How long entries live, what every verdict means, and how to carve holes in the cache when correctness demands it. This is the lesson that makes caches debuggable.
~35 min read Open learning -
LearningnginxIntermediate
8.4 Stale Serving, Herd Collapse, and Micro-Caching
The four techniques that turn a cache from an accelerator into an architecture: survive origin failures, absorb stampedes, refresh invisibly, and make the dynamic feel static.
~40 min read Open learning -
LearningnginxIntermediate
8.5 Slice and Large Files: Caching for Media
A 10 GB video in one cache entry is a 10 GB hole in your disk and a 10 GB wait for the first byte. The slice module cuts big content into cacheable, parallel, resumable pieces.
~35 min read Open learning -
LearningnginxIntermediate
9.1 Workers, Connections, and Limits
Before you tune anything, learn what the knobs actually turn — and how to read the receipts the system gives you. Folklore tuning is how boxes end up slower than their defaults.
~35 min read Open learning -
LearningnginxIntermediate
9.2 Buffers and the Kernel Seam
Every byte that crosses NGINX lands in a buffer someone sized. Most “NGINX is slow” tickets are a buffer story wearing a disguise — this lesson teaches you to read all of them.
~35 min read Open learning -
LearningnginxIntermediate
9.3 gzip Done Right
The 54 KB text file that becomes 240 bytes. No other directive in NGINX buys that ratio — and no other is misconfigured as often.
~35 min read Open learning -
LearningnginxIntermediate
9.4 Brotli and Modern Compression
Brotli typically beats gzip 15–25% on text and costs nothing to serve to clients that can’t speak it. The catch: it’s a dynamic module, so the edge must load it first — receipts included.
~30 min read Open learning -
LearningnginxIntermediate
9.5 HTTP/3 and QUIC
TCP was designed before HTTP existed. QUIC was designed *for* it — and this lesson closes the module with a real HTTP/3 handshake over UDP, verified byte by byte.
~35 min read Open learning -
LearningnginxAdvanced
10.1 Below HTTP: The Stream Module
NGINX's second career: the same master/worker engine, the same event loop — but the unit of work is no longer "a request". It's "a connection".
~35 min read Open learning -
LearningnginxAdvanced
10.2 TCP Proxying & Load Balancing
Module 5's upstream toolbox, rebuilt for connections: scheduling happens once, pins for life — and the failure receipts look deliciously familiar.
~35 min read Open learning -
LearningnginxAdvanced
10.3 PROXY Protocol
A TCP proxy is also a lie factory: every upstream sees 127.0.0.1 as the client. The PROXY protocol is the one-line confession that fixes it.
~25 min read Open learning -
LearningnginxAdvanced
10.4 UDP Proxying
UDP has no connections — so NGINX invents them. Understanding the invention (and its timeout-defined lifetime) is the whole lesson. Plus: a real datagram-eating bash gotcha, caught and fixed.
~30 min read Open learning -
LearningnginxAdvanced
10.5 TLS Passthrough with SNI Routing
The party trick that makes security teams smile: route encrypted traffic by hostname without holding a single private key. Then the adult conversation: when not to.
~35 min read Open learning -
LearningnginxAdvanced
11.1 The Rewrite Engine
Three directives — return, rewrite, set — run before any content handler, before access rules, before almost everything. That earliness is their power and their danger.
~35 min read Open learning -
LearningnginxAdvanced
11.2 The if Trap and Its Cures
"location if" is a rewrite-phase directive pretending to be a control structure. Inside it, you are standing in a different location than you think — reproduced step by step.
~35 min read Open learning -
LearningnginxAdvanced
11.3 Delegated Auth: auth_request
auth_basic proves you know a password. mTLS proves who your CA says you are. auth_request lets ANY HTTP service decide — cookies, JWTs, business rules — and NGINX enforces the verdict.
~35 min read Open learning -
LearningnginxAdvanced
11.4 Shadow Traffic: mirror
Ship v2 by running it in the dark: every production request duplicated to the new code, its responses thrown away, the client never the wiser.
~25 min read Open learning -
LearningnginxAdvanced
11.5 Signed URLs & Protected Downloads
Two production workhorses, one theme: NGINX and the application each do the half they’re best at. secure_link puts trust in the URL; X-Accel-Redirect puts the bytes back in NGINX’s hands.
~40 min read Open learning -
LearningnginxAdvanced
12.1 The Access Log as a Data System
The access log is the cheapest, richest telemetry you own: every request, every verdict, zero new infrastructure. Treated as a schema, it becomes your first real data system.
~30 min read Open learning -
LearningnginxAdvanced
12.2 Structured JSON Logs
escape=json is one parameter and it changes everything: your access log becomes a document stream every pipeline can consume. Getting it valid under ALL conditions is the engineering.
~30 min read Open learning -
LearningnginxAdvanced
12.3 Golden Signals & Upstream Forensics
Latency, traffic, errors, saturation — the four questions every dashboard answers. Everything you need is already in the log line; this lesson is about reading it like an SRE.
~35 min read Open learning -
LearningnginxAdvanced
12.4 stub_status & Live Metrics
Logs are history; stub_status is now. One location, seven counters, zero dependencies — the OSS answer to "is the front door alive and how hard is it working?"
~25 min read Open learning -
LearningnginxAdvanced
12.5 Conditional Logging & Error Discipline
Log everything and you log nothing: the signal drowns in the routine. Recording only what matters — by request, by severity — plus the rotation and retention that keep logs honest.
~30 min read Open learning -
LearningnginxAdvanced
13.1 Static Config, Dynamic Fleet — and the Discovery Landscape
NGINX reads its upstreams once, at config load — your fleet changes every minute; this opener names the lifecycle mismatch, the discovery contract any runtime fix must meet, and the production landscape — plain DNS, Consul's two doors, Kubernetes controllers, the Plus API — the rest of the module teaches you to ride.
~40 min read Open learning -
LearningnginxAdvanced
13.2 The Resolver Directive
One directive, three parameters, two completely different resolution contexts — and a config-load gotcha you can hit on your very first nginx -t. Know which resolver answers which name.
~30 min read Open learning -
LearningnginxAdvanced
13.3 Runtime Re-resolution: variable proxy_pass
The pattern that made dynamic upstreams possible in OSS NGINX a decade before upstreams could resolve: put a variable in proxy_pass, and the name becomes a runtime question.
~30 min read Open learning -
LearningnginxAdvanced
13.4 zone + resolve: Upstream Groups That Move
Since 1.27.3, OSS upstreams can hold DNS-named servers that re-resolve at runtime — you keep the Module 5 toolbox (weights, quarantine, least_conn) AND runtime membership.
~30 min read Open learning -
LearningnginxAdvanced
14.1 The Edge Blueprint
Where does NGINX sit? The answer decides your TLS story, your failure domain, and who your debuggers blame. The topology map — and the questions each tier forces you to answer.
~30 min read Open learning -
LearningnginxAdvanced
14.2 NGINX in Containers
A containerized NGINX is the same binary and same config inside an environment that quietly removes four things the package install gave you. This is the checklist that keeps it production-safe.
~30 min read Open learning -
LearningnginxAdvanced
14.3 The Ingress Model
Kubernetes didn’t invent new routing concepts — it renamed the ones you already know. The translation table: every Ingress object you’ll ever read, as the NGINX config it becomes.
~30 min read Open learning -
LearningnginxAdvanced
14.4 Operating a Mini Ingress Controller
You’ve read what controllers do; now run one. Forty lines of shell — manifest, renderer, validator, reloader — that move real traffic when the fleet changes. Every receipt is real.
~35 min read Open learning -
LearningnginxAdvanced
14.5 Choosing Your Ingress
ingress-nginx, F5 NGINX Ingress Controller, Gateway API implementations, Envoy-shaped alternatives — the architecture module’s last lesson is a decision, made once, lived with for years.
~30 min read Open learning -
LearningnginxAdvanced
15.1 The Extension Landscape
You need a thing NGINX doesn’t do. Before reaching for any tool, know the four you’re choosing between — each buys a different kind of power and bills a different kind of cost.
~25 min read Open learning -
LearningnginxAdvanced
15.2 Building NGINX from Source
Three commands and ninety seconds: ./configure, make, make install. The skill is knowing what configure decides on your behalf — those choices become your binary’s contract with the world.
~30 min read Open learning -
LearningnginxAdvanced
15.3 Dynamic Modules & Binary Compatibility
One directive loads new code into a running architecture; one signature rule decides whether it loads at all. The exact error a mismatch produces — and the version-pinning that prevents it.
~35 min read Open learning -
LearningnginxAdvanced
15.4 njs: Scripting the Request
Everything config can’t express: parsing tokens, classifying clients, generating JSON, deciding routes — in sandboxed JavaScript that couldn’t segfault your worker if it tried.
~35 min read Open learning -
LearningnginxAdvanced
15.5 Brotli, Measured
The config was Lesson 9.4's and the build was 15.2/15.3's — this lesson is the wire's turn to talk: 285 bytes became 50 while gzip managed 77, and the fine print (HTTPS-only browser br, CDNs, streaming) turns into runbook material.
~15 min read Open learning -
LearningnginxAdvanced
16.1 The Debugging Method
Tools don't debug; method does. The layers of the stack, the instrument for each, and the discipline of turning symptoms into receipts before touching a single directive.
~25 min read Open learning -
LearningnginxAdvanced
16.2 The Debug Build
Every malloc, every parsed header, every phase transition, every keep-alive decision — narrated, timestamped, attributed to a worker and connection. The debug build is NGINX’s flight recorder.
~30 min read Open learning -
LearningnginxAdvanced
16.3 /proc Forensics
strace is missing, gdb is missing, ptrace is locked — and /proc doesn’t care. The kernel’s own filesystem tells you what every process holds, waits on, and is allowed to do.
~30 min read Open learning -
LearningnginxAdvanced
16.4 Core Dumps
The worker died with a scream. The master shrugs, respawns, moves on — but the scream was recorded: a core file holding the exact moment of death. Capturing and reading it is the craft.
~30 min read Open learning -
LearningnginxAdvanced
16.5 Profiling & Flame Graphs
Where does the CPU actually GO? perf answers with a flame graph; a locked-down host says no — so this lesson builds the honest rootless substitute and maps when each weapon wins.
~30 min read Open learning