Module 2 - Traffic & Load

Forward vs Reverse Proxy

Two types of proxies that sit at different points in the request flow.

1The Receptionist Analogy

Simple Analogy
Forward Proxy (Your Assistant): You want to call a company but don't want them to know your number. Your assistant makes the call on your behalf. The company sees the assistant's number, not yours.

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

ClientForward ProxyInternet/Servers

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

ClientReverse ProxyBackend Servers

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

AspectForward ProxyReverse Proxy
PositionIn front of clientsIn front of servers
HidesClient identityServer identity
Configured byClient sideServer side
Primary usePrivacy, filteringLoad balancing, security
Client awarenessClient knows about proxyClient unaware of proxy

5Key Takeaways

1Forward proxy sits in front of clients-hides client identity
2Reverse proxy sits in front of servers-hides server infrastructure
3Reverse proxies enable load balancing, SSL termination, caching
4Nginx and HAProxy are the most common reverse proxies
5Most web applications use a reverse proxy in production

?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?