NGINX, DNS & load balancing in practice
Reverse proxying, TLS termination, upstreams and health checks, caching headers, DNS TTL games during migrations. The config file behind half the internet.
The mental model
Picture a busy restaurant. Customers arrive at the door; they never wander into the kitchen. A host stands at the entrance: greets you, checks your reservation, decides which of the six waiters is least busy, and sends you to their section. If a waiter walks off shift, the host stops seating them. If the whole kitchen is on fire, the host hands you a printed apology instead of letting you starve at an empty table.
NGINX is that host. It is a reverse proxy: clients connect to it, never to your application servers. It terminates TLS (checks the reservation), picks an upstream (chooses the waiter), and can serve a cached or static response itself without bothering the kitchen at all.
Two words trip up beginners:
- A forward proxy sits in front of clients and hides them from the internet (corporate egress proxy).
- A reverse proxy sits in front of servers and hides them from clients. NGINX is almost always doing this.
And there is a layer above NGINX: DNS. DNS is the phone book that tells the client which door to walk to in the first place. It is not a load balancer — it has no idea whether a server is healthy — but its TTL controls how quickly the world notices when you move the door. Half of all migration outages are somebody forgetting to lower a TTL a day early.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision