skip to content

Both a forward proxy and a reverse proxy sit between a client and a server and relay traffic. What actually distinguishes them — which side deploys and configures each, and what does each one hide from the other side?

level: juniorimportance: must knowfreq 72%

answer

  1. whose agent is the box
  2. who has to configure it
  3. one hides clients, one hides servers
  4. client never learns the reverse one exists
  5. two connections, so the peer address changes

basics

~20 s

A forward proxy acts for the clients and is configured on the client side, so the origin server sees only the proxy. A reverse proxy acts for the service owner, is deployed in front of the backends, and the client never knows it exists.

solid answer

~50 s

Both relay traffic, but they act for opposite sides. A forward proxy is deployed on behalf of clients — a browser, an OS or a container is configured to use it, for example through `HTTPS_PROXY` — so it sees who the client is and where they are heading, while the origin server sees only the proxy's address. That is how corporate egress filtering, allowlisting and shared caching work. A reverse proxy is deployed by whoever owns the service: the client simply resolves the site's name, connects, and has no idea a proxy is there. It terminates the client's connection and opens its own connection to a backend, which is what lets you add TLS, routing, caching or a second backend without changing the application. The consequence of that second connection is that the backend now sees the proxy's address, not the client's — which is exactly why forwarded-address mechanisms exist.

code

bash · 9 lines
bash
# Forward proxy: the client side opts in, explicitly or by environment
curl -x http://proxy.corp.internal:3128 https://api.example.com/health

export HTTPS_PROXY=http://proxy.corp.internal:3128
curl https://api.example.com/health

# Reverse proxy: nothing on the client mentions a proxy at all
unset HTTPS_PROXY
curl -sS https://app.example.com/health

go deeper

for a junior

Be ready to say plainly which side sets each one up: the client is configured to use a forward proxy, while a reverse proxy is deployed by the service and the client never knows. Name one everyday use of each.

for a middle

Explain the mechanics: the proxy terminates one connection and opens another, so the backend's view of the peer, the scheme and sometimes the host all change. Say what has to be forwarded deliberately as a result.

for a senior

Show you have operated one. Talk about what breaks when the forwarded facts are missing or wrongly trusted — logging, allowlists, abuse attribution, scheme-dependent redirects — and how you verify at each hop rather than guessing.

for a principal

Own the placement decision: what belongs at a client-side egress control point versus at the service edge, who operates each, and what a shared egress address or a single edge tier costs you in blast radius, attribution and partner allowlisting.

## Same machinery, opposite loyalties A proxy is any intermediary that accepts a connection from one party and makes its own connection to another party on someone's behalf. A forward proxy and a reverse proxy both do precisely that, with the same sockets and often the same software. What separates them is **whose agent the box is**, and every practical difference follows from that single fact. A **forward proxy** works for the *client population*. Somebody on the client side — an IT department, a build environment, a developer's tooling — decides that outbound traffic goes through it. The origin server is not consulted and usually cannot tell; it just receives a connection from the proxy's address. A **reverse proxy** works for the *service owner*. The client resolves `app.example.com`, connects to whatever address that name points at, and that address belongs to the proxy. The client normally cannot tell a proxy is involved at all, and that opacity is the entire point. ## Who configures it This is the fastest way to classify a box in a real system. A forward proxy has to be *told to the client*: browser or OS proxy settings, a PAC file, the `HTTP_PROXY`/`HTTPS_PROXY` environment variables that most HTTP libraries and CLIs honour, or a per-invocation flag such as curl's `-x`. A reverse proxy is configured by the *service*: it is what DNS points at, and the client's configuration says nothing about it. ```bash # forward proxy: the CLIENT is configured curl -x http://proxy.corp.internal:3128 https://api.example.com/health # reverse proxy: nothing on the client says "proxy" curl https://app.example.com/health ``` ## What each one hides A forward proxy **hides clients from servers**. A thousand workstations appear to the internet as one egress address — convenient when a partner wants to allowlist you, and inconvenient when a rate limiter upstream counts you as one very busy client. It also gives the client side a control point: category and destination allowlists, auditing of who reached what, shared caching of large downloads, and credential injection for outbound calls. A reverse proxy **hides servers from clients**. It conceals how many backends there are, what addresses and ports they listen on, which instance served this request, and whether they even speak the same protocol version the client used. That concealment is what buys you freedom: you can terminate TLS at the edge, add compression or caching, split traffic by path onto two different services, or replace the backend entirely, and no client changes. ## Two connections, not one The most consequential detail, and the one candidates skip: the client's TCP connection — and its TLS session, if the proxy terminates TLS — **ends at the proxy**. The proxy then opens a *separate* connection to the backend. ``` client ──TLS──▶ reverse proxy ──plain HTTP──▶ backend (connection 1) (connection 2) ``` Everything that was a property of connection 1 — the peer address, the negotiated TLS and any client certificate, sometimes the protocol version and the host the user typed — is now merely information the proxy may *choose* to carry across as data. Nothing about connection 2 reveals it automatically. That single fact explains a family of production surprises: application logs that show one internal address for every request; rate limiting and IP allowlists that suddenly apply to the whole world at once; an app that believes it was called over plain HTTP when the user typed `https://`; and session logic keyed on client address that starts behaving oddly. The remedy is always the same shape — the proxy must forward the missing facts explicitly, and the backend must only believe them when they come from that proxy. ## The interception case A third arrangement confuses people: the *transparent* or *intercepting* proxy, where traffic is redirected to a proxy at the network layer without the client ever being configured. In role it is still a forward proxy — it acts for the client side and hides clients from servers — but the client did not opt in and its software may not even know. That distinction matters when things break: an unconfigured client will not fall back or report a proxy error the way a configured one does. ## Where load balancers and gateways fit Both are reverse proxies with an emphasis on a particular job. Any argument about whether a box is "a load balancer or a reverse proxy" is usually an argument about vocabulary, not architecture, and it is worth resolving by asking which responsibilities you want at that hop. ## What interviewers actually probe The definitional half is the warm-up. The real follow-up is nearly always *"so how does your application still see the real client?"* — because that is where the two-connection model stops being trivia and starts being the reason a redirect loops, an allowlist fails open, or an abuse report names the wrong address.

  • Where does a transparent or intercepting proxy fit into that split?
    It is a forward proxy the client never opted into: traffic is redirected to it at the network layer rather than configured in the client. The role is unchanged — it acts for the client side and hides clients from origins — but the client software does not know, so failures surface as strange connection errors rather than clean proxy errors.
  • Your backends log every single request as coming from 10.0.0.4. Which role causes that, and is it a defect?
    A reverse proxy causes it, and it is inherent rather than a defect: the proxy terminated the client's connection and opened its own, so the backend's peer address is the proxy. To recover the original address the proxy has to forward it explicitly, and the backend should accept that claim only when the connection came from the proxy itself.
  • Why would a team put a forward proxy in front of outbound calls from their own services?
    To get a control point on egress: a single stable address partners can allowlist, an audit trail of which service reached which third party, destination allowlisting so a compromised service cannot call anywhere it likes, and sometimes shared caching. The cost is one more hop that can fail and one more place to configure timeouts and TLS trust.

A forward proxy is the mailroom your office makes you post through; a reverse proxy is the receptionist at the company you are writing to. You choose the first; the recipient chooses the second, and you may never know they have one.

saying these in an interview costs you the question

  • A reverse proxy is just a forward proxy pointed the other way
  • The client configures the reverse proxy in its browser settings
  • The proxy hands the same TCP connection straight to the backend
  • The backend automatically still sees the real client address
  • Forward proxies exist only for caching web pages

context