Dev tools

Reverse Proxy vs Load Balancer: The Difference

Reverse proxy vs load balancer: a reverse proxy fronts your servers, a load balancer shares traffic between them. See the overlap, with examples.

By OmniAI Editorial · Nov 22, 2026 · 12 min read

In reverse proxy vs load balancer, the difference is the job each one is defined by. A reverse proxy sits in front of your servers and handles requests on their behalf: it hides them, terminates encryption, caches responses and forwards each request to the right backend. A load balancer sits in front of several identical servers and spreads requests across them, skipping any that have failed. A reverse proxy makes sense even with a single backend server; a load balancer only makes sense with more than one. In practice the two overlap so much that the same software, such as NGINX, usually does both.

This guide explains what is a reverse proxy, what a load balancer adds, reverse proxy vs forward proxy, how the two overlap, worked examples with numbers, an NGINX reverse proxy configuration, a table that sorts out proxy vs reverse proxy vs load balancer and the mistakes that cause bugs in real deployments.

Reverse Proxy vs Load Balancer at a Glance

Reverse proxyLoad balancer
Main jobStand in front of servers and forward requests for themSpread requests across multiple servers
Needs several backends?No: useful with oneYes: pointless with one
Typical featuresTLS termination, caching, compression, header changes, access rulesBalancing algorithm, health checks, failover
Sees HTTP?Yes (a layer 7 device)Layer 4 (TCP/UDP) or layer 7 (HTTP)
ImprovesSecurity, performance, flexibilityCapacity and availability
Example toolsNGINX, Caddy, Apache, HAProxy, EnvoyCloud load balancers, HAProxy, NGINX, Envoy

A load balancer that works at layer 7 is a reverse proxy with a particular specialty. That is the key to the whole topic: every HTTP load balancer is a reverse proxy, but not every reverse proxy balances load.

What Is a Reverse Proxy?

What is a reverse proxy? It's a server that accepts requests from clients, forwards them to one or more backend servers and returns the backend's response, so the client talks only to the proxy. NGINX's documentation describes the behaviour directly: it sends the request to a specified proxied server, fetches the response and sends it back to the client.

The client doesn't know, or need to know, which machine produced the answer. That single indirection is useful in many ways:

What a reverse proxy doesWhy it helps
Hides the backendsServers aren't exposed to the internet; only the proxy has a public address
Terminates TLSThe proxy handles certificates and encryption; backends can speak plain HTTP internally
Caches responsesRepeated requests for the same content never reach the application
Compresses and optimisesShrinks responses on the way out
Serves static filesImages, scripts and styles are served quickly without troubling the application
Routes by host or pathapp.example.com and api.example.com, or /blog and /shop, go to different backends
Adds security controlsRate limiting, IP allow and block lists, request size limits, a web application firewall
Rewrites headersAdds the original client address or a request ID
Enables zero-downtime changesSwap or restart a backend while the proxy keeps accepting connections
A light panel with a grey cloud joined by a line to a grey card carrying a lock, a cache tag and a dial, then an orange line to a grey box.
A reverse proxy adds a lock, a cache and a gauge in front of the server it protects.

Reverse Proxy vs Forward Proxy

Reverse proxy vs forward proxy is the other half of the vocabulary. They face opposite directions:

Forward proxyReverse proxy
Sits in front ofClients (users)Servers
Acts on behalf ofThe user, to reach the internetThe server, to receive requests
Who configures itThe user or their organisationThe server owner
The other side seesThe proxy's address, not the user'sThe proxy's address, not the server's
Typical usesContent filtering, anonymity, corporate access controlLoad distribution, TLS, caching, protection

A company web filter or a VPN-style proxy is a forward proxy: it protects or controls the client side. The proxy in front of a website is a reverse proxy.

NGINX Reverse Proxy Example

A minimal NGINX reverse proxy passes requests to an application listening on port 8000 and tells it the real client address. This follows the pattern in NGINX's documentation:

server {
    listen 80;
    server_name app.example.com;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass http://localhost:8000;
    }
}

By default NGINX changes two request headers when proxying, Host and Connection, which is why the Host header is set explicitly, so the application sees the name the client used. Proxy buffering is on by default, which means NGINX reads the whole response from the backend before passing it to the client. In Caddy the same idea is one line, reverse_proxy localhost:8000, inside a site block. Our comparison of NGINX vs Caddy explains the trade-offs between the two.

What Is a Load Balancer?

A load balancer shares incoming traffic across a group of servers and checks that each is healthy before sending it work. It exists for two reasons: capacity (one server can't handle all the traffic) and availability (if one fails, the others keep serving). It needs a pool of backends and a rule for choosing among them:

AlgorithmHow it picksBest for
Round robinTakes turns (the default in NGINX)Similar servers and similar requests
Weighted round robinGives bigger servers more turnsMixed hardware
Least connectionsSends to the server with fewest active connectionsLong or uneven requests
IP hashSame client always goes to the same serverSimple stickiness
Hash on a keySame URL or key goes to the same serverCaches

A layer 4 load balancer forwards TCP or UDP connections without reading them, which is very fast and works for any protocol. A layer 7 load balancer reads HTTP and can route by path, host or header, which is where it starts to look like a reverse proxy.

How Reverse Proxies and Load Balancers Overlap

The categories blur because the software is the same. NGINX, HAProxy and Envoy all proxy requests and balance them. If you add a second backend to an NGINX reverse proxy, you have a load balancer:

upstream backend {
    server backend1.example.com weight=5;
    server backend2.example.com;
    server 192.0.0.1 backup;
}

server {
    location / {
        proxy_pass http://backend;
    }
}

The upstream block defines the pool (the first server gets five times the default weight, and the backup is used only when the others are unavailable) and proxy_pass points at it. Same tool, same proxying, one extra job.

SituationWhat you have
NGINX in front of one app server, terminating TLSA reverse proxy
NGINX in front of three identical app serversA reverse proxy that is also a load balancer
A cloud network load balancer passing TCP to serversA load balancer that isn't a reverse proxy (layer 4)
A cloud application load balancer routing by pathA load balancer that is also a layer 7 reverse proxy

Worked Examples With Numbers

Example 1: One Server, Why Add a Reverse Proxy?

A small web app runs on one server and handles 1,000 requests per second at peak. Of those, 800 are for images, scripts and styles that rarely change. If a reverse proxy serves those from its cache or disk, only the remaining 200 requests per second reach the application, an 80% reduction in application load. TLS also moves to the proxy, so the application code never touches certificates. There's still one backend, so there is nothing to balance, but the proxy has already paid for itself.

Example 2: When a Load Balancer Becomes Necessary

Suppose each application server comfortably handles 200 requests per second, and traffic grows to 500. One server can't cope. You need at least ceil(500 / 200) = 3 servers, and to survive one failing you need a fourth, so 4 servers. Something must share the 500 requests across those four and notice when one stops responding: that is the load balancer. With four healthy servers, each handles about 125 requests per second; if one fails, the three remaining handle about 167 each, still under their limit of 200. Without the health check, a quarter of the requests would be sent to a dead server and fail.

Two light panels: on the left a small square, a door-shaped box and a box in a row, on the right a door-shaped box fanning lines to four grey boxes, the third with an orange cross.
A reverse proxy is useful with one server; a load balancer needs several and removes a failed one.

Proxy vs Reverse Proxy vs Load Balancer

Here is how the neighbouring terms fit together.

TermSits in front ofMain purposeNeeds multiple servers?
Forward proxyClientsControl or hide client trafficNo
Reverse proxyServersProtect, accelerate and route to serversNo
Load balancerServersShare load and survive failuresYes
API gatewayAPI back endsAuthentication, quotas, API policyNo
CDNServers, globallyCache content near usersNo
Ingress controllerA Kubernetes clusterRoute outside traffic to servicesUsually

A CDN is essentially a worldwide network of reverse proxies with caches. An API gateway is a reverse proxy specialised for APIs. An ingress controller is a reverse proxy and load balancer built to run inside a Docker and Kubernetes cluster. The family is one idea applied with different emphasis.

Which Do You Need?

Your situationWhat you need
One server, want HTTPS, caching, or clean URLsReverse proxy
Several identical servers, need to survive a server failureLoad balancer (which can be a reverse proxy with an upstream pool)
Different paths or hostnames going to different servicesReverse proxy with routing rules
Raw TCP or UDP traffic (databases, games, mail)Layer 4 load balancer
Expose a home server without opening portsA reverse proxy or tunnel; see Cloudflare Tunnel vs Tailscale
Hide backend servers from the internetReverse proxy
Protect against one client hammering youReverse proxy with rate limiting

Common Mistakes

  • Losing the client's real address. Behind a proxy, your application sees the proxy's address unless you pass the original in a header such as X-Forwarded-For or X-Real-IP, and configure the application to trust it only from the proxy.
  • Forgetting the Host header. The backend may serve the wrong site or generate wrong links if it doesn't see the original host.
  • Buffering streaming responses. Proxy buffering is on by default in NGINX, which delays responses such as server-sent events or large streamed downloads. Turn it off for those routes.
  • No health checks. Without them, a balancer keeps sending traffic to a dead server.
  • Making the proxy a single point of failure. One proxy in front of many servers just moves the failure point. Run two or use a managed service.
  • Exposing backend ports. If servers are reachable directly, the proxy's protection can be bypassed.
  • Mismatched timeouts. If the proxy times out before the backend finishes, users get errors while the backend keeps working.
  • Sticky sessions as a crutch. Pinning users to a server hides state problems and makes failures louder.
  • Assuming they're different products. The same NGINX or HAProxy configuration often covers both roles.

FAQ

What is the difference between a reverse proxy and a load balancer?

A reverse proxy forwards client requests to backend servers on their behalf and adds features like TLS termination, caching and security. A load balancer spreads requests across several servers and removes failed ones. A layer 7 load balancer is a reverse proxy that specialises in balancing.

Is a reverse proxy the same as a load balancer?

No, but they overlap. A reverse proxy works with a single server; a load balancer needs several. Many tools, such as NGINX and HAProxy, can act as both, so one configuration often does the two jobs.

What is a reverse proxy used for?

A reverse proxy is used to hide and protect backend servers, terminate TLS, cache and compress responses, serve static files, route traffic by host or path and apply rate limits. It's common in front of even a single web application.

What is the difference between a forward proxy and a reverse proxy?

A forward proxy sits in front of clients and makes requests for them, for example to filter or hide user traffic. A reverse proxy sits in front of servers and receives requests for them. They face opposite directions.

Can NGINX be both a reverse proxy and a load balancer?

Yes. With proxy_pass it works as a reverse proxy, and pointing proxy_pass at an upstream group of servers turns it into a load balancer with methods such as round robin, least connections and IP hash.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog