<strong>Reverse proxy</strong> is a server that sits in front of your web servers and forwards client requests to them. It acts as a gateway, providing load balancing, caching, SSL termination, and security.
The Hotel Receptionist Analogy
Guests don't directly access roomsβthey go through the receptionist who assigns rooms, handles keys, and manages everything. Similarly, clients don't directly access your servers; the reverse proxy manages all requests.
Guest (Client)
Wants a room
Receptionist (Reverse Proxy)
Handles requests
Rooms (Servers)
Actual services
Sends Request
Nginx/HAProxy
Process Request
Client sends request
User visits your website
Reverse proxy receives
Nginx/HAProxy acts as single entry point
Proxy makes decisions
Load balance, cache, or forward to backend
Backend processes
Application server handles the request
Proxy returns response
May cache response for future requests
Wrong
"Reverse proxy and load balancer are the same"
Correct
A reverse proxy can do <strong>load balancing plus more</strong>: SSL termination, caching, compression, security filtering. Load balancer is just one feature of a reverse proxy.
Using Nginx as reverse proxy:
Handles SSL/TLS encryption (HTTPS) for all backend servers
Caches static content to reduce backend load
Distributes traffic across multiple app servers
Protects backend servers from direct internet exposure