Load Balancer vs Reverse Proxy
People think a load balancer and a reverse proxy are two different kinds of server, and very often they are one and the same. A reverse proxy takes each request and passes it to a server behind it. A load balancer is a reverse proxy that shares the work across many servers. Nginx can do both jobs. With just one app server behind it, there is no load to share.
Load Balancer
A box that hands out web traffic to many servers. Users see one address.
A load balancer spreads incoming requests across a group of servers. Users reach one address, and the balancer picks a server for each request. It can take turns, or pick the server with the least work. It runs health checks and stops sending traffic to a server that fails. So you can add a server, or lose one, and users do not notice.
Reverse Proxy
A server in front of your apps. It takes each request and passes it on.
A reverse proxy is a server that sits in front of your app servers and takes every request first. It passes each one on to a server behind it and sends the answer back. Visitors never talk to the app servers directly. On the way, it can handle TLS, cache answers, block bad traffic and share the load.
In one line
- Load Balancer
- A box that hands out web traffic to many servers. Users see one address.
- Reverse Proxy
- A server in front of your apps. It takes each request and passes it on.