spyderproxy

Reverse Proxy vs Load Balancer (2026)

D

Daniel K.

|
Published date

Sun May 17 2026

Quick verdict: Every load balancer is technically a reverse proxy — both accept inbound connections on behalf of one or more backends. The distinction in 2026 is operational, not architectural. A load balancer emphasizes distributing traffic across many backends (and usually operates at L4 for raw throughput). A reverse proxy emphasizes application-layer features: TLS termination, caching, URL rewrites, auth, observability (and usually operates at L7). Tools like NGINX, HAProxy, Envoy, and Traefik happily wear both hats. The labels matter only when you're picking a tool: do you need raw packet routing across 100k connections per second, or do you need to manipulate HTTP requests?

The Two Definitions

Reverse ProxyLoad Balancer
Primary purposeFront backends with app-layer featuresDistribute requests across backends
OSI layerL7 (HTTP)L4 (TCP) or L7 (HTTP)
Number of backendsOne or manyMany by definition
AwarenessHTTP semantics (headers, paths, methods)L4: just sockets. L7: same as reverse proxy.
Typical featuresTLS, caching, compression, URL rewrite, auth, A/B routingHealth checks, weighted routing, session affinity, connection pooling
Throughput per box10k–100k RPS100k–1M+ packets/sec (L4)
ExamplesNGINX, Traefik, Caddy, Cloudflare, EnvoyHAProxy (L4), AWS NLB, IPVS, kube-proxy, F5

L4 vs L7: Where the Real Distinction Lives

L4 Load Balancer

An L4 LB sees TCP packets. It picks a backend (based on source IP + port hash, round-robin, least-connections) and forwards packets there. It doesn't parse the application protocol. AWS Network Load Balancer (NLB), Azure Standard LB, IPVS in Linux kernel, and HAProxy in TCP mode all operate L4.

  • Pros: Insanely fast (millions of packets/sec), protocol-agnostic (TCP, UDP, TLS pass-through), low latency.
  • Cons: Can't make decisions based on HTTP path / header / cookie. No TLS termination (it just forwards bytes). No caching.

L7 Reverse Proxy / Load Balancer

An L7 proxy terminates the inbound TCP, parses the HTTP request, and makes routing decisions based on path, host, headers, method, cookies, body. It can rewrite URLs, add headers, cache responses, terminate TLS, do authn/authz. NGINX, Traefik, Envoy, ALB, Cloudflare all operate L7.

  • Pros: Full app-layer routing, TLS termination, caching, compression, header manipulation, WAF integration.
  • Cons: Slower than L4 (10x typically), uses more CPU, only handles application protocols it understands (HTTP, gRPC, WebSocket).

The Overlap

Modern L7 proxies are load balancers. NGINX has upstream blocks with multiple servers and load-balancing algorithms (least_conn, ip_hash, random). HAProxy in HTTP mode does the same. Envoy was built for service mesh and is a load balancer by default. The distinction "reverse proxy or load balancer" is a false choice for these tools — pick the right tool, configure both functions.

When You Want L4

  • Non-HTTP protocols. MySQL, PostgreSQL, gRPC over raw TCP, custom binary protocols, MQTT. L7 proxies can't parse these (well).
  • Maximum throughput. 1M+ packets/sec on commodity hardware.
  • TLS pass-through. Backend handles TLS; LB just forwards encrypted bytes.
  • Lowest latency. Game servers, high-frequency trading, low-latency APIs.

Tooling: AWS NLB, GCP TCP LB, Azure Standard LB, IPVS, HAProxy TCP mode, kube-proxy (when not using IPVS mode).

When You Want L7

  • HTTP / gRPC services. Microservices, web apps, APIs.
  • Path-based routing. /api goes to one service, /static to another.
  • Host-based routing. Multi-tenant apps, multiple domains on one IP.
  • TLS termination. Centralize SSL certs at the edge.
  • Caching, compression, header manipulation.
  • A/B testing, canary releases, blue/green.
  • WAF, rate limiting, JWT auth.

Tooling: NGINX, Envoy, Traefik, Caddy, AWS ALB, GCP HTTPS LB, Azure App Gateway, Cloudflare.

Tools Side-by-Side (2026)

ToolL4L7Best at
NGINX (+ Plus)YesYesMature L7, caching, static files, vast plugin ecosystem
HAProxyYesYesHighest-throughput L4, ACL-based L7
EnvoyLimitedYesService mesh, observability, gRPC, xDS dynamic config
TraefikYesYesContainer-native, auto-discovery, Let's Encrypt out of the box
CaddyLimitedYesZero-config HTTPS, simple config, small ops surface
AWS NLBYesNoL4 at AWS scale
AWS ALBNoYesL7 at AWS scale, integrates with Cognito, WAF
kube-proxy / IPVSYesNoKubernetes Service routing
CloudflareSpectrumYesEdge L7 with DDoS, WAF, cache; L4 via Spectrum

In Kubernetes

Both labels apply in different layers of the stack:

  • Service (ClusterIP) — kube-proxy / IPVS does L4 load balancing across Pod IPs.
  • Service (LoadBalancer) — provisions a cloud L4 LB (NLB equivalent).
  • Ingress — an L7 reverse proxy (typically NGINX, Traefik, or Envoy) running inside the cluster, terminating TLS and routing by host/path.
  • Gateway API — the 2024+ successor to Ingress, also L7, more expressive.
  • Service Mesh (Istio, Linkerd) — L7 proxies (Envoy sidecars) for every Pod, doing mTLS, observability, retries.

Load-Balancing Algorithms

AlgorithmHow it picks a backendWhen to use
Round RobinEach request to the next backend in sequenceStateless, identical backends
Least ConnectionsBackend with fewest active connectionsLong-lived connections (WebSocket, DB)
IP HashHash of client IP picks backendSession affinity without cookies
Consistent HashStable mapping under backend changesCaches, sharded services
Weighted Round RobinBackends with higher weight get moreHeterogeneous backends
Least Response TimeBackend with lowest p50Latency-sensitive APIs
RandomPseudo-random pickOften enough, simpler than LC

Health Checks

Both types do health checks, but L7 health checks are smarter:

  • L4: Open a TCP socket; if it accepts, the backend is "up". Cheap, fast, but a stuck app accepting connections without responding looks "healthy".
  • L7: Make a real HTTP request; check the response status, body, or a specific endpoint (/healthz). Catches app-level failures (stuck app, OOM, deadlock).

Related: Reverse proxy master guide · Forward proxy explained · What is a proxy server?