What is the difference between forward and reverse proxies?
Useful first: HTTP · optional, not a requirement
Choose your depth
Stay with the essentials, or look closer.
YOUR GOALRecognize client-side and website-side proxy roles in an everyday request.
Whose side does the intermediary serve?
A helper for the visitor
Imagine a school computer fetching a museum guide. Its browser is configured to send web requests through the school’s forward proxy. That intermediary handles requests for the school’s clients, including requests to different websites.
Think of a librarian who fetches books for a class. The librarian represents the readers. This analogy explains the role, not a guarantee about privacy or how every network is configured.
[1] [2]A front desk for the website
The museum can put a reverse proxy in front of its own web servers. Visitors address the museum service, and the intermediary passes requests to the appropriate server behind it. A reception desk directing visitors to departments is a useful analogy.
A reverse proxy may also provide load balancing or caching. Those are optional capabilities, not requirements for being a reverse proxy. Both kinds of proxy can carry requests toward a service and responses back to a visitor.
[2] [4]Ask whether the proxy represents the requesting clients or the service they are visiting.
A reverse proxy only carries responses, while a forward proxy only carries requests.
Both handle traffic in both directions. The distinction is the client or service they act for.
Show the explanation
A reverse proxy for the museum’s service. The entry point fronts the museum’s servers. Its role is reverse proxying, even though both requests and responses pass through it.
YOUR GOALRead HTTP/1.1 request targets and trace a reverse proxy’s configured backend route.
Follow an HTTP request through the proxy
A forward proxy needs the destination
For an ordinary, unencrypted HTTP GET sent to a forward proxy using HTTP/1.1, the request target contains the full destination URI:
GET http://museum.example/guide HTTP/1.1
Host: museum.exampleWhen requesting that resource directly from its server, the usual form is:
GET /guide HTTP/1.1
Host: museum.exampleThese fragments omit the remaining headers and terminating blank line. CONNECT and server-wide OPTIONS use other target forms. Do not treat a full URI as conclusive proof of a proxy: HTTP/1.1 origin servers must accept that form too.
[3]A reverse proxy follows service configuration
Suppose the museum’s public service sends /guide requests to a guide application and /tickets requests to a ticket application. Visitors keep using the museum’s public address; the reverse proxy chooses the backend according to its configuration.
For a forwarded request, it obtains the backend response and relays it to the client. For example, NGINX can use a location rule and proxy_pass to select a backend. Configuration can also change the backend path or headers, so debugging should compare what the proxy received with what the application received.
Identify the public destination, the next connection and the request that the next server actually receives.
A reverse proxy must use the same path and Host header on every connection.
The public request and the backend request can differ according to the proxy’s routing and header configuration.
Show the explanation
GET http://museum.example/guide HTTP/1.1 This GET uses the absolute URI form. A CONNECT target instead uses a host and port, without a path.
YOUR GOALDistinguish a CONNECT tunnel from TLS termination and avoid trusting client-supplied forwarding claims.
Separate tunneling, TLS and trusted metadata
CONNECT changes how bytes are relayed
An HTTP/1.1 client can request a tunnel with this fragment:
CONNECT museum.example:443 HTTP/1.1
Host: museum.example:443After a successful 2xx response, the connection switches to tunnel mode. The intermediary relays bytes in both directions instead of processing each tunneled exchange as an HTTP message. A failed response does not establish the tunnel.
CONNECT itself supplies no encryption; a client can establish TLS through the tunnel. The destination host and port are present in the CONNECT request. Operators should restrict allowed tunnel destinations or ports rather than provide an unrestricted relay.
[5] [8]TLS termination creates a different boundary
When a reverse proxy terminates the browser’s TLS connection, it decrypts that connection’s traffic so it can process the HTTP request. It may then use a separate HTTPS connection to its backend. Encrypting the backend hop and verifying the backend certificate require their own configuration.
For example, a museum may protect both browser-to-proxy and proxy-to-application connections with TLS. The proxy still sees the HTTP content between those connections. That differs from a plain CONNECT tunnel carrying TLS between the client and destination. See HTTPS for what an encrypted connection protects.
[9] [6] [5]Forwarded information needs a trust boundary
A backend’s immediate network peer may be the reverse proxy. The standardized Forwarded header can convey information about earlier hops, but a client or intermediary can supply or change that field.
Suppose an application uses a claimed client address from Forwarded to grant access. The header’s presence alone does not make that decision safe. A deployment needs a defined set of trusted intermediaries and protected communication to them; values describing earlier, untrusted hops do not become reliable merely because they passed through a trusted proxy.
[7]Locate the TLS endpoints and the trusted metadata boundary before drawing conclusions about a proxied request.
Any Forwarded header reaching an application proves the original client’s identity.
Forwarded is metadata that can be forged or modified. Trust depends on the verified proxy chain and deployment policy.
Show the explanation
There are two TLS connections, and the proxy can process the HTTP content between them. TLS terminates at the proxy on the first hop. A separate encrypted backend connection protects the second hop; it does not hide content from the proxy itself.
Keep asking. Check the details.
Source-checked using AI (OpenAI Codex) on . The checks covered sources, examples, and quizzes for this article version.
No human review is claimed. AI review can miss errors; check the original sources below.
- RFC 9110 — HTTP intermediaries
- MDN — Proxy servers and tunneling
- RFC 9112 — HTTP/1.1 request-target forms
- NGINX — Reverse proxy request handling
- RFC 9110 — CONNECT
- NGINX — Securing HTTP traffic to upstream servers
- RFC 7239 — Forwarded header validity and integrity
- MDN — CONNECT request method
- NGINX — TLS termination at the HTTPS server