Forward vs Reverse Proxy
Two types of proxies that sit at different points in the request flow.
1The Receptionist Analogy
Reverse Proxy (Company Receptionist): You call a company. The receptionist answers and routes you to the right department. You never directly call individual employees.
2Forward Proxy
A forward proxy sits in front of clients, making requests on their behalf. The server sees the proxy's IP, not the client's.
Request Flow
Privacy/Anonymity
Hide client IP from destination servers
Content Filtering
Block access to certain websites (corporate networks)
Caching
Cache responses to reduce bandwidth
Access Control
Control which sites users can access
Examples: Squid, corporate firewalls, VPNs (act similarly)
3Reverse Proxy
A reverse proxy sits in front of servers, receiving client requests and forwarding them to backend servers. Clients see only the proxy.
Request Flow
Load Balancing
Distribute requests across multiple backend servers
SSL Termination
Handle HTTPS, forward HTTP to backends
Caching
Cache responses to reduce backend load
Security
Hide backend infrastructure, add WAF protection
Compression
Compress responses before sending to clients
Rate Limiting
Protect backends from too many requests
Examples: Nginx, HAProxy, Cloudflare, AWS ALB, Traefik
4Comparison
| Aspect | Forward Proxy | Reverse Proxy |
|---|---|---|
| Position | In front of clients | In front of servers |
| Hides | Client identity | Server identity |
| Configured by | Client side | Server side |
| Primary use | Privacy, filtering | Load balancing, security |
| Client awareness | Client knows about proxy | Client unaware of proxy |
5Key Takeaways
?Quiz
1. A company wants to block employees from accessing social media. Which proxy type?
2. Nginx sits in front of your web servers to distribute traffic. What type is it?