Appearance
Forward Proxy vs Reverse Proxy
Forward Proxy
Sits between client and internet. Client talks to proxy, proxy talks to internet on behalf of client.
Client --- Forward Proxy --- Internet
(hides client)Server sees proxy's IP, not client's IP — client identity is hidden.
Reverse Proxy
Sits between internet and servers. Client talks to proxy, proxy talks to backend servers on behalf of servers.
Client --- Reverse Proxy --- Backend Servers
(hides servers)Client sees proxy's IP, not server's IP — server identity is hidden.
Side by Side
Forward Proxy:
[Client] --- [Proxy] --- [Internet/Server]
known hides client sees proxy
Reverse Proxy:
[Client] --- [Proxy] --- [Backend Servers]
sees proxy hides servers knownForward Proxy — Use Cases
| Use Case | How |
|---|---|
| Bypass geo-restrictions | Client routes through proxy in another country |
| Corporate filtering | Company proxy blocks certain sites |
| Anonymity | Server never knows real client IP |
| Caching | Proxy caches responses for multiple clients |
Examples: VPN, Squid proxy, browser proxy settings
Reverse Proxy — Use Cases
| Use Case | How |
|---|---|
| Load balancing | Distribute traffic across servers |
| TLS termination | Handle HTTPS, pass HTTP to backend |
| Caching | Cache responses, reduce backend load |
| DDoS protection | Hide and protect origin servers |
| Rate limiting | Block abusive clients at proxy level |
| API Gateway | Route /api/users → user service, /api/orders → order service |
Examples: Nginx, Cloudflare, AWS ALB, Traefik
Key Difference — Who Is Being Hidden?
| Forward Proxy | Reverse Proxy | |
|---|---|---|
| Hides | Client | Server |
| Protects | Client's identity | Server's identity/infrastructure |
| Who configures it | Client side | Server side |
| Client knows about it | Yes | No |
Nginx as Reverse Proxy (Common Interview Example)
Client --HTTPS--> Nginx (reverse proxy)
├── Node.js app :3000
├── Node.js app :3001
└── Node.js app :3002Nginx handles TLS, load balancing, caching — backend just runs plain HTTP.