Building Blocks

Reverse Proxy

Understanding reverse proxies and their role in system architecture.

2 min readConcepts · System Design

What is a Reverse Proxy?

A Reverse Proxy sits in front of backend servers and forwards client requests to them. Unlike a forward proxy (which acts on behalf of clients), a reverse proxy acts on behalf of servers.


Forward vs Reverse Proxy


Reverse Proxy Functions

1. Load Balancing

Distribute requests across multiple backend servers.

2. SSL Termination

Handle HTTPS encryption/decryption at the proxy:

3. Caching

Cache responses to reduce backend load:

4. Compression

Compress responses before sending to clients.

5. Security

  • Hide backend server details
  • Filter malicious requests
  • Rate limiting
  • Web Application Firewall (WAF)

Common Use Cases

Use CaseHow Reverse Proxy Helps
API GatewayRoute to different microservices
Static contentServe cached files
SSL offloadingCentralized certificate management
A/B testingRoute traffic to different versions

SoftwareStrengths
NGINXHigh performance, widely used
HAProxyLoad balancing focus
TraefikContainer-native, auto-discovery
EnvoyService mesh, observability

NGINX Example

server {
    listen 80;
    server_name example.com;

    location /api/ {
        proxy_pass http://backend-servers;
    }

    location /static/ {
        root /var/www/static;
    }
}

Interview Tips

  • Differentiate forward vs reverse proxy
  • Know common functions: SSL termination, caching, load balancing
  • Mention security benefits
  • Give examples: NGINX, HAProxy, cloud load balancers

Finished reading?

Mark it done to track your progress in Concepts.