The Geekist Library  /  Volume One

NGINX by Example.

A practical guide to NGINX, drawn from real-world deployments and scribbled sticky notes.

A field manual for the real problems: securing traffic, routing requests and making NGINX work beyond a tutorial.

Real configurationsBun-tested examplesOpen source companion
NGINX by Example Volume 1 book cover, featuring a green squid on a light background
The book, and the working code behind it.
From problem to pattern to productionRead it. Run it. Understand it.

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 repository

02 / 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.

Routing model / illustrative
IncomingRequests
Reverse proxyNGINX
Blue / 95Current version
Green / 5New version
The bars show configured upstream weights, not live traffic telemetry.

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.

Request path / illustrative
Client/api/
NGINXauth_request
Auth serviceValidate token
Valid token → API200
Invalid / absent → deny403
The same configuration also applies a five-requests-per-second rate-limit zone with a burst allowance.

Pattern 03.4 / The invisible CDN

Let the server deliver the bytes.

Let the application pick the resource, then let NGINX handle delivery.

Internal handoff / illustrative
Client/avatar
NGINXX-Accel-Redirect
Internal/images/
Internal handoff200
Direct external access404
The repository demonstrates the internal-location behaviour with a deliberately minimal local configuration.

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 ↗
theGeekist / nginx-by-example  ·  quick start
# Bun and Docker required
$ docker compose up -d –build
$ bun test

# Or run a chapter’s tests
$ bun test sections/2.4_blue_green_deployments/index.test.ts
Real HTTP requestsChapter-mapped configsReproducible environment

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.

Embedded PDF unavailable on your device. Open the PDF sample ↗

Free sample · Read on the pageOpen PDF separately ↗

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.

Formats, availability and current prices are shown by each retailer. A visit to a retailer is not counted as a completed purchase.

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.

A Geekist publication  ·  Written from experience, tested in code

Get Geekist in your inbox

    Choose your newsletters. Confirm your email to subscribe.

    Choose your newsletters

    Read the privacy policy