Reverse Proxy Explained
A forward proxy hides clients; a reverse proxy hides servers. It sits in front of your infrastructure, receives all traffic, and forwards requests to your backend: adding TLS termination, caching, load balancing, and a security layer on the way.
Proxy vs direct
| Aspect | Proxy | Direct |
|---|---|---|
| Origin IP | Hidden | Public |
| TLS | At proxy | At origin |
| DDoS | Absorbed | On you |
What it adds
- TLS termination: one certificate at the proxy, plain HTTP to your backends internally.
- Caching: static assets and hot responses served without touching the origin.
- Load distribution: round-robin or health-checked forwarding across multiple backends.
- Security: rate limiting, IP filtering, WAF integration, and hidden backend topology.
The examples you already know
- Nginx: the classic self-hosted reverse proxy; proxy_pass directives route paths to upstreams.
- Cloudflare: a reverse proxy as a global service, with the orange cloud enabling it; DNS points at the edge, not your origin.
- Load balancers (AWS ALB, GCP LB) are reverse proxies specialized for distribution with health checks.
Frequently asked questions
Is a reverse proxy the same as a CDN?+
A CDN is a globally distributed reverse proxy with caching at hundreds of locations; a local Nginx proxy is the same concept on one machine.
Does it break WebSockets?+
Proxies need explicit upgrade handling for WebSockets; both Nginx and Cloudflare support it with configuration.
Why terminate TLS at the proxy?+
Centralized certificate management. Internal traffic between proxy and backend can then use a private PKI or plain HTTP on a trusted network.
Do I need one with a PaaS?+
No: Vercel/Netlify/Heroku already front your app with their own proxies and load balancers.
What is X-Forwarded-For?+
The header a reverse proxy adds to carry the real client IP to your backend; trust it only from your own proxies, or attackers can spoof it.
Related
Last verified: 2026-10-28