A reverse proxy is a server that sits in front of one or more web servers and forwards client requests to them, while a load balancer spreads requests across several servers so no single one gets overloaded. Most HTTP load balancers are reverse proxies with a balancing feature, but a reverse proxy is useful even with one server.
| Reverse proxy | Load balancer | |
|---|---|---|
| Main job | Receive requests on behalf of servers and pass them on | Spread requests across a group of servers |
| Needs more than one server | No | Yes |
| Typical features | TLS termination, caching, compression, routing by path, attack filtering | Balancing methods, health checks, session persistence |
| Works at | HTTP (layer 7) | HTTP (layer 7) or TCP and UDP (layer 4) |
| Examples | NGINX, Apache HTTP Server, Caddy, CDNs | NGINX, HAProxy, cloud load balancers |
What is a reverse proxy?
A reverse proxy is a server that takes requests from clients on behalf of one or more backend servers, forwards each request to the right server and returns the response as if it came from the proxy. The HTTP standard, RFC 9110 (June 2022), calls it a gateway: an intermediary that acts as the origin server for the outbound connection.
Visitors only ever see the reverse proxy's address. That lets the reverse proxy handle TLS, cache responses, compress content and filter attacks for every server behind it. Our guide to what a reverse proxy is covers it in depth, forward vs reverse proxies compares it with the client-side kind, and what a proxy server is covers the basics.
What is a load balancer?
A load balancer is a server or service that spreads incoming requests across a group of servers, so the work is shared and one failed server doesn't take the site down. It tracks which servers are healthy and stops sending traffic to any that fail.
Load balancers work at one of two layers:
- Layer 7 (HTTP): reads each request, so it can route by URL, header or cookie. A layer 7 load balancer is a reverse proxy.
- Layer 4 (TCP and UDP): routes by IP address and port without reading the HTTP request. Some layer 4 load balancers forward packets without ending the connection, so they don't act as proxies at all.
What is the difference between a reverse proxy and a load balancer?
The difference between a reverse proxy and a load balancer is that a reverse proxy describes where a server sits, in front of your servers, while a load balancer describes one job, spreading traffic across several of them. The NGINX glossary explains that load balancers are deployed when requests are "too much for a single server," while a reverse proxy makes sense "even with just one web server."
In practice the two overlap. NGINX, HAProxy and most cloud HTTP load balancers are reverse proxies that also balance load, and one NGINX config can do both jobs at once.
Which load balancing methods are there?
The main load balancing methods are round robin, least connections and hashing, and they differ in how they pick the next server. The NGINX load balancing docs describe these methods:
| Method | How it picks a server | Good for |
|---|---|---|
| Round robin (NGINX default) | Each server in turn, optionally weighted | Servers of similar size with similar requests |
| Least connections | The server with the fewest active connections | Requests that take very different amounts of time |
| IP hash | A hash of the client's IP address | Keeping each client on the same server |
| Generic hash | A hash of a key you choose, such as the URL | Spreading a cache across servers |
Keeping a client on the same server is called session persistence. In NGINX Open Source, the IP hash and generic hash methods provide it, and NGINX Plus adds a sticky directive that uses cookies.
How do you set up NGINX as a load balancer?
You set up NGINX as a load balancer by listing your servers in an upstream block and pointing proxy_pass at that block, which makes the same NGINX instance both the reverse proxy and the load balancer:
upstream app_servers {
server 10.0.0.11:3000;
server 10.0.0.12:3000;
server 10.0.0.13:3000;
}
server {
listen 80;
location / {
proxy_pass http://app_servers;
}
}Add least_conn; at the top of the upstream block to switch from round robin to least connections. We tested this setup with NGINX 1.24.0 in November 2026 using three local backends, one of them switched off: all 12 test requests returned 200, split six and six between the two live servers. NGINX logged one refused connection to the dead server, retried that request on a live one, and sent no more traffic to it for the rest of the test.
Do you need a reverse proxy, a load balancer or both?
You need a reverse proxy as soon as you want TLS, caching or a single public address in front of an app, and you need a load balancer once one server can't handle the traffic or you can't afford downtime. Here's how common setups split:
- One server: a reverse proxy only, for TLS, compression and caching.
- Two or more servers: a reverse proxy that also load balances, such as NGINX with an upstream block.
- Large or multi-region sites: a layer 4 or cloud load balancer in front of several reverse proxies, often with a CDN at the edge.
Why does this matter for web scraping?
Reverse proxies and load balancers matter for web scraping because they decide which backend server answers each of your requests and often enforce the site's rate limits. Two requests to the same URL can reach different servers, which can return slightly different content, and session persistence can tie a logged-in session to one server through a cookie.
For multi-step scraping, keep the cookies the site sets and the same IP address for the whole session, so the load balancer keeps routing you consistently.
Rayobyte proxies give each request a new IP address by default, and a sticky session keeps one IP across requests. The sticky sessions docs list soft sticky sessions on residential, rotating ISP and rotating datacenter proxies, and strict sticky sessions, which fail rather than switch IPs, on residential only. Premium Residential sessions last up to 120 minutes.
Rayobyte's residential proxies use IP addresses from home internet connections, and rotating proxies change the IP address on each request for jobs that don't need a session.