We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
2 system design questions lean on this idea. Each walks through the full answer.
System Design Masterclass · Load Balancing Proxies
Free preview: the first 2 parts of this 8-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Load Balancing Proxies
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
The previous lesson's worked for the client. This one works for the servers, and it is deployed by the people who run them.
The purpose is not primarily security or speed. It is indirection: clients hold one address, and everything behind that address becomes free to change.

Clients resolve one name, so , certificates and firewall rules all have exactly one target.
One of the blocks in that picture is being restarted, and nobody outside can tell. That is what makes deploys, scaling and failover possible without coordinating with anybody.
Every other feature in this lesson, TLS termination, load balancing, caching, , is something you can only do once there is a single place that sees every request. The front door comes first and everything else is built on it.
The most consequential thing about a reverse is what it does to the backend's view of the world, and it is almost never drawn.

The connection genuinely comes from the proxy, so every fact about the original request arrives in a header that the proxy chose to add.
If the proxy does not add them, the backend simply does not know.
That is easy to check, because a reverse proxy is a short program.

The middle block is the part worth reading twice. The backend's own view of who connected is the proxy, every time, and the client's identity is a header.
When a backend is removed, the client changes nothing and notices nothing.
Two bugs follow directly from this, and both are common. or geo-blocking on the peer address limits the proxy, not the client. And building a redirect from the scheme the backend saw produces an http:// URL for a user who arrived over https.

Four of these are conventions rather than standards, which is why every web framework has a setting for which one to read and how many hops to trust.
None of them is authenticated in any way.
The security rule is short: strip these headers at your outermost proxy and set them yourself. If you append to whatever arrived, a client can put anything it likes at the front of the list and your rate limiter will believe it.