The Geekist Library / Volume One
NGINX by Example.
A practical guide to NGINX, drawn from real-world deployments and scribbled sticky notes.
Get your copy Choose your platform
A field manual for the real problems: securing traffic, routing requests and making NGINX work beyond a tutorial.

01 / The premise
This book is a field manual.
NGINX by Example distils over a decade of real-world experience into practical, tested configurations you can use today.
Each chapter begins with a problem, presents a usable pattern, then looks at the edge cases and operational realities that make the difference between a working example and a production system.
Wildcard SSL, smarter gateways, traffic shaping, caching strategies that don’t suck. The common thread is a conviction that NGINX is more than a web server. It’s an extraordinarily capable part of the platform.
Meet the companion repository02 / From the pages
A few patterns, out in the open.
These aren’t mock configurations invented for a landing page. Each preview comes from a corresponding section of the companion repository, with a Bun test that exercises the behaviour. Choose one to explore.
Pattern 02.4 / Blue-green deployments
Release a new version without flipping the whole switch.
Send a small share of requests to the new version while most traffic stays on the current one.
upstream app_pool {
server 127.0.0.1:3000 weight=95;
server 127.0.0.1:3001 weight=5;
}200 HTTP requests; the assertions expect more than 85% of responses from blue and fewer than 15% from green. This is a statistical tolerance around the configured split.
Pattern 02.5 / Smart API gateways
Check the request before it reaches your API.
Check credentials before a request reaches your application. Keep identity and throttling at the edge.
location /api/ {
auth_request /validate_token;
auth_request_set $tenant_id
$upstream_http_x_tenant_id;
limit_req zone=api_limit
burst=10 nodelay;
proxy_pass http://api_backend;
}Missing tokens, valid tenant credentials, invalid tokens and burst rate limiting. The repository tests make HTTP requests rather than only inspecting the configuration.
Pattern 03.4 / The invisible CDN
Let the server deliver the bytes.
Let the application pick the resource, then let NGINX handle delivery.
location /avatar {
add_header X-Accel-Redirect
/images/logo.png;
return 200;
}
location /images/ {
internal;
root /etc/nginx/srv;
}The test expects a successful response and an X-Accel-Redirect header for /avatar, while direct access to /images/ returns 404.
These are selected illustrations of repository configurations and test assertions, not a live test report. The complete source and setup instructions are available on GitHub.
03 / The sister repository
The book explains.
The repo runs.
Each section maps to the book and includes its own NGINX configuration and Bun test. A Docker environment supplies the services. You can follow the explanation, change the configuration and see how the requests behave.
Explore the full repository ↗04 / Open the book
A few pages, before you decide.
Read the pages here, just as you would in the book. No sign-in. See the writing, the examples and the level of detail before choosing your edition.
05 / Take it with you
Keep the field manual close.
Pick the format that suits your working life. The companion configurations remain freely available, whichever edition you choose.
Get the book and support the work directly.
Kindle & printAmazonA copy for your reader or your desk.
Digital editionLeanpubAnother way to keep the reference handy.
Formats, availability and current prices are shown by each retailer. A visit to a retailer is not counted as a completed purchase.
06 / Beyond the book
The rabbit hole doesn’t end at the last page.
07 / A few details
Before you go.
Who is NGINX by Example for?
Developers, operators and engineers who want working patterns with explanations and tests, not configuration fragments without context. It covers practical routing, SSL, caching and other real infrastructure problems.
Are the configurations included?
Yes. The open source companion repository contains chapter-mapped NGINX configurations, Docker setup and Bun tests. You can explore the code without buying the book.
Is there a paperback?
The book page currently links to Amazon for Kindle and paperback options. Check the retailer for current availability and pricing. Gumroad and Leanpub also offer purchasing options.
Will there be more volumes?
That’s the plan. Future volumes are intended to explore dynamic routing with njs, advanced scripting and open-source NGINX modules.
Can I support the work directly?
You can support the book through Gumroad or make a contribution at paypal.me/jjnathan. It helps keep the writing and development going.