CDNs and Proxies
Put servers between users and your origin - to hide, filter and cache - and push static content close to the user.
Proxies
A proxy is a server that sits in the middle and forwards requests on behalf of someone else. Which side it represents decides the name.
| Forward proxy | Reverse proxy | |
|---|---|---|
| Acts for | The client | The server |
| Hides | The client's identity from the website | The servers from the client |
| Typical use | Company network filters, privacy, caching for an office | Load balancing, TLS, caching, security in front of your app |
| Example tools | Squid, corporate proxy | Nginx, HAProxy, Envoy, Cloudflare |
You will almost always design with a reverse proxy. The user talks to example.com; behind it, the proxy picks one of many app servers.
What a reverse proxy usually does for you:
- TLS termination: it handles HTTPS encryption, so the app servers speak plain HTTP inside the private network.
- Load balancing across app servers (the previous lesson).
- Caching of responses, compression (gzip, Brotli) and rate limiting.
- Hiding internal addresses, so attackers see one entry point.
1 of 8