Serksa
All Concepts
Performance & Scaling

Reverse Proxy

1

What is it?

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

2

Think of it like...

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

3

Visual Flow

🌐Client

Sends Request

β†’
πŸ›‘οΈReverse Proxy

Nginx/HAProxy

β†’
πŸ–₯️Backend Servers

Process Request

4

Where you see it

1

Client sends request

User visits your website

2

Reverse proxy receives

Nginx/HAProxy acts as single entry point

3

Proxy makes decisions

Load balance, cache, or forward to backend

4

Backend processes

Application server handles the request

5

Proxy returns response

May cache response for future requests

5

Common Mistake

❌

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.

πŸ’‘ Real-World Example

Using Nginx as reverse proxy:

1

Handles SSL/TLS encryption (HTTPS) for all backend servers

2

Caches static content to reduce backend load

3

Distributes traffic across multiple app servers

4

Protects backend servers from direct internet exposure