Reverse Proxy
What is it?
A reverse proxy is a server that sits in front of your backend servers, receiving client requests and forwarding them to the right backend.
Explain like I'm 5
Why was it created?
Exposing backend servers directly is insecure and inflexible. A reverse proxy was adopted to centralize entry, security, and routing in front of them.
Where is it used?
- In front of web/app servers
- TLS termination
- Routing by path or host
- Load balancing and caching
Why should developers care?
Reverse proxies are everywhere in web infrastructure, handling TLS, routing, and load balancing — common ground for backend and ops roles.
How does it work?
Clients connect to the reverse proxy as if it were the server. It applies rules — terminating HTTPS, routing by URL, balancing load, caching — then forwards each request to a backend and relays the response.
Real-world example
One reverse proxy routes /api requests to the API servers and everything else to the web servers, while handling HTTPS for both.
Common use cases
- Single secure entry point
- Path/host-based routing
- TLS termination
- Load balancing and caching
Advantages
- Hides and protects backends
- Centralizes TLS and routing
- Enables load balancing and caching
- Simplifies client connections
Disadvantages
- Another component to run and secure
- Can be a single point of failure if not redundant
- Adds a network hop
When should you use it?
Whenever you want a controlled, secure front door to one or more backend services.
When should you avoid it?
For a single simple service with no routing, TLS, or scaling needs yet.
Alternatives
Related terms
Interview questions
Beginner
- What is a reverse proxy?
- How is it different from a forward proxy?
Intermediate
- What is TLS termination at a proxy?
- How does it route requests to backends?
Senior
- How does a reverse proxy differ from an API gateway?
- How do you make the proxy itself highly available?
Common misconceptions
- "A reverse proxy and a forward proxy are the same" — a forward proxy fronts clients; a reverse proxy fronts servers.
- "A reverse proxy is just a load balancer" — balancing is one feature; routing, TLS, and caching are others.
Fun facts
- A forward proxy represents the client; a reverse proxy represents the server.
- Nginx and HAProxy are popular reverse-proxy software.
Timeline
- 1990s — Reverse proxies become common for web scaling and security
Learning resources
Quick summary
A reverse proxy fronts your backend servers, handling routing, TLS, load balancing, and caching from a single secure entry point.
Cheat sheet
- Sits in front of backends
- Routes, terminates TLS, balances, caches
- Hides and protects servers
- Fronts servers (vs forward proxy fronts clients)