nginxcurlDockerAdvanced~4h

Nginx & Proxies

Say what the proxy will do

Most arguments about a failing deployment are settled by two published algorithms and four defaults nobody reads. This is the machine in the middle, drilled until reading one is fast and writing one comes to hand: which block answers, what the origin is asked, who it believes is calling, what the cache filed it under.

Modules
6
Drills
14
Build steps
3
Time
~4h

Walk out able to

Take a configuration you have never seen and say what it does to a request — and take a symptom and name the one line that produced it.

What you drill

01

Which block wins

Server names and the location order, run by hand.

02

What the origin receives

The target, the headers, and the client it believes in.

03

Pools and certificates

Weighted shares, failure clocks, and the edge handshake.

04

The cache in the middle

Its verdict, its key, and how long a copy may be served.

The pitch

What you practise, and what you leave with

Not an artifact — a reading speed: every procedure drilled, the lines that spell them, and a two-block proxy of your own.

You will practise

  • Location and server-name matching, by hand
  • Proxy targets, headers, and the client address
  • Weighted pools and the passive-failure clock
  • Certificates at the edge, and the cache key

Afterwards you can

  • Name the block that serves a given request
  • Say what address the origin believes you are
  • Work out a weighted share and a failure clock
  • Name the rule behind a redirect loop

Modules

6 modules, 29 items

Lessons explain one idea. Drills repeat it until it sticks. Build steps make something that exists afterwards.

  1. 1

    Which block serves this

    ~39 min

    Run both selection algorithms: the server block first, then the location.

    • LessonWatch a request get routed twice6 min
    • LessonRun the server-name priority6 min
    • LessonRun the location order7 min
    • DrillName the block that serves it11 min
    • DrillPick the server block9 min
  2. 2

    Hand it to the origin

    ~21 min

    Say what target and what headers the origin is actually asked with.

    • DrillSay what reaches the origin10 min
    • DrillSay what headers arrive11 min
  3. 3

    Who the client is

    ~38 min

    Name the address the origin believes, and where the belief came from.

    • LessonWhy the origin sees one address6 min
    • LessonDecide which entry to believe7 min
    • DrillName the address the origin sees12 min
    • DrillFind the forwarding fault13 min
  4. 4

    Spread it across backends

    ~20 min

    Work out a weighted share, and say when a failed backend comes back.

    • DrillWork out the share9 min
    • DrillSay if the backend is out11 min
  5. 5

    Terminate TLS at the edge

    ~38 min

    Say which certificate a handshake could use, and what termination hides.

    • LessonWhat the handshake decides5 min
    • LessonMatching a block is not matching a name7 min
    • LessonWhat termination hides from the origin5 min
    • DrillSay which certificate is served9 min
    • DrillFind the TLS edge fault12 min
  6. 6

    Cache in front of the origin

    ~1h

    Read the cache, write the directives yourself, and run a proxy of your own.

    • DrillSay what the cache did10 min
    • DrillSay whether they share an entry11 min
    • DrillWork out how long it lives9 min
    • DrillWrite the line that does it10 min
    • Build stepPut a proxy in front of an origin8 min
    • Build stepGive the origin the host you asked for5 min
    • Build stepHand the origin the caller's address7 min
    • LessonDiagnose a backend with no traffic6 min
    • LessonDiagnose a header that stopped arriving5 min
    • LessonDiagnose a pool that is quietly two4 min
    • LessonDiagnose two customers sharing a page5 min

The config is right. The request went somewhere else.

The first item is free. ~4h of focused work, at your own pace.

Advanced~4h6 modules