Proxy vs Reverse Proxy

Two middlemen that sit in the request path for opposite reasons — one protects clients, the other protects servers.

Proxy vs reverse proxy in 30 seconds

  • A proxy is a middleman in the request path that can inspect, modify, cache, or route traffic.
  • Forward proxy: acts for the client — hides client identity, enforces policy, caches outbound fetches.
  • Reverse proxy: acts for the server — load balancing, TLS termination, caching, hiding internal topology.
  • The memory hook: forward sits in front of clients, reverse sits in front of servers.
  • In a design: the reverse proxy is usually the first box behind the client (Nginx, HAProxy, Envoy).
  • The family: a load balancer and an API gateway are just specialized reverse proxies.

The receptionist and the mailroom

Picture a big office building. Out front there's a mailroom your staff drop outgoing letters at — it stamps everything with the company's return address, screens what's allowed to go out, and keeps copies of things it fetches often. Inside, there's a receptionist who greets every visitor, checks their appointment, and quietly directs them to whichever employee is free — the visitor never learns which desk or floor actually handled them.

Those are the two kinds of proxy. The mailroom is a forward proxy: it works for the people inside (the clients), facing out to the world. The receptionist is a reverse proxy: it works for the building (the servers), facing the visitors. Same idea — a middleman in the path — pointed in opposite directions. Hold onto that image; it's the whole page.

The problem it solves

Sometimes you don't want clients and servers talking directly. A proxy is an intermediary that sits in the middle of the connection and can inspect, modify, cache, or route traffic. The confusing part is that there are two kinds that face opposite directions — a forward proxy acts on behalf of the client, a reverse proxy acts on behalf of the server.

What goes wrong with no middleman at all

Why insert a box in the middle at all? Because when every client talks straight to every server, a pile of concerns has nowhere to live. Consider what you lose without one:

  • Every server must terminate its own TLS — decrypting HTTPS, managing certificates, renewing them, on every box.
  • Clients see your raw topology — real server IPs are exposed, so an attacker can target individual machines directly.
  • Cross-cutting work gets copy-pasted — caching, rate limiting, auth checks, and compression get reimplemented in every service.
  • No single place to spread load — clients would have to know and choose among your servers themselves.
  • No chokepoint for policy — an office can't filter or audit outbound traffic if each machine reaches the internet on its own.

A proxy is the shared doorway where all of that naturally belongs. The direction it faces decides whose problems it solves.

Same idea, opposite sides: client-facing vs server-facing.

Forward proxy: on the client's side

A forward proxy sits between a group of clients and the wider internet. The client's request goes to the proxy, which forwards it on. It's used to hide client identity (the server sees the proxy's IP), enforce policy (corporate filters that block certain sites), and cache frequently fetched external content for a whole office or network.

A forward proxy: filter, cache, then fetch on the client's behalf (pseudocode)
on request from an internal client:
    if blocklist.contains(request.host):
        return deny("blocked by company policy")   # enforce egress rules
    if cache.fresh(request.url):
        return cache.get(request.url)               # serve a shared cached copy
    response = fetch(request)            # the proxy's IP is what the server sees
    cache.store(request.url, response)
    return response                      # client stays anonymous to the origin

The server on the far end has no idea who the real client was — it only ever saw the proxy. That anonymity (and the shared cache, and the policy chokepoint) is exactly the point.

Reverse proxy: on the server's side

A reverse proxy sits in front of your servers. Clients think they're talking to one machine, but the proxy decides which backend actually handles each request. This is the workhorse of web architecture: it does load balancing, TLS termination (decrypting HTTPS once so backends don't each have to), caching, compression, and hiding your internal topology so attackers can't see individual servers.

A reverse proxy: terminate TLS, add headers, forward to a backend (pseudocode)
on request from client:
    terminate_tls(request)                       # decrypt HTTPS once, here
    request.headers["X-Forwarded-For"] = client.ip   # backend learns real client
    request.headers["X-Forwarded-Proto"] = "https"
    backend = pool.pick()                        # load-balance across servers
    response = forward(request, to = backend)    # client never sees the backend
    return response

The two, side by side

AspectForward proxyReverse proxy
Acts forThe clientThe server
HidesClient identity from the serverServer topology from the client
Typical useContent filtering, client anonymity, egress cachingLoad balancing, TLS termination, caching, security
Who deploys itThe client's network/organizationThe service owner

What TLS termination actually buys you

'TLS termination' sounds like jargon, but it names one of the biggest reasons reverse proxies exist. Terminating TLS means the proxy is where the encrypted HTTPS connection ends — the proxy decrypts the request, and your backends receive plain HTTP over the trusted internal network. Doing this in one place instead of on every server pays off several ways:

  • One place to manage certificates. Renewals, rotation, and new domains are handled at the edge, not on a dozen app servers.
  • Backends skip the crypto CPU cost. Encryption/decryption is expensive; centralizing it frees your app servers to do real work.
  • Uniform TLS policy. One spot enforces modern protocol versions and strong ciphers for everything behind it.
  • A clean seam for zero-trust. For sensitive setups you can start a second, internal TLS hop from the proxy — a deliberate choice, not a default.
TLS terminates once at the edge; internal hops run on a trusted network.

Proxy, reverse proxy, load balancer, API gateway

These overlap and people blur them. A reverse proxy is the general category; a load balancer is a reverse proxy specialized in spreading traffic across a pool; an API gateway is a reverse proxy specialized in API concerns (auth, rate limiting, request shaping). In practice one piece of software often plays several of these roles — what matters is being clear about which concern you're talking about.

NameIt's a reverse proxy specialized in…Reach for it when
Reverse proxyThe general job — forwarding, TLS, caching, hiding topologyYou need any server-side middleman
Load balancerSpreading traffic across a healthy poolScale and availability are the focus
API gatewayAPI concerns: auth, rate limits, routing, shapingYou front many services with one entry point
CDNEdge caching close to users, globallyStatic or cacheable content, worldwide

The reverse proxy is where cross-cutting concerns live — it's the box that quietly does load balancing, TLS, caching, and security before a request ever reaches your app, and understanding it unifies several components people treat as separate.

Why it matters

  • Naming the reverse proxy correctly signals you know where cross-cutting concerns belong in an architecture.
  • It centralizes the expensive-and-risky work — TLS, caching, security — so each backend doesn't reinvent it.
  • Seeing load balancers and API gateways as specialized reverse proxies keeps your mental model clean.

If ignored

  • You swap the directions and describe a forward proxy doing a reverse proxy's job (or vice versa).
  • You scatter TLS termination and caching across every backend instead of handling them once at the edge.
  • You treat 'reverse proxy', 'load balancer', and 'API gateway' as unrelated and muddle the design.

Where it fits

  • The reverse proxy sits right behind the client, usually the first box in the server-side request path.
  • The forward proxy lives on the client's network, controlling and caching outbound traffic.
  • It's the natural home for load balancing, TLS termination, caching, compression, and edge security.

Related topics

  • Load balancing: a reverse proxy specialized in spreading traffic across a pool
  • API gateway: a reverse proxy specialized in API concerns like auth and rate limiting
  • CDN: edge caching that's essentially a reverse proxy near the user
  • DNS: resolves the name that points clients at your reverse proxy

Interview lens

Questions it unlocks

  • What's the difference between a forward and a reverse proxy?
  • Where would you terminate TLS, and why?
  • How is a reverse proxy different from a load balancer?

60-second answer

A forward proxy fronts clients and hides their identity or enforces policy; a reverse proxy fronts servers and handles load balancing, TLS termination, caching, and hiding internal topology. In a design, the reverse proxy is usually the first box behind the client, and it often doubles as the load balancer and TLS terminator. I'd describe a load balancer and an API gateway as specialized reverse proxies — one for spreading traffic, one for API concerns — so I'm precise about which job each box is doing.

Common traps

  • Swapping the two directions — forward is client-side, reverse is server-side.
  • Treating 'reverse proxy' and 'load balancer' as unrelated rather than overlapping roles.
  • Forgetting TLS termination as a core reverse-proxy responsibility.

Search topics

↑↓ to move · Enter to open · Esc to close