Forward Proxy vs Reverse Proxy
Forward and reverse proxies look alike on a diagram. Both sit in the middle and pass requests along. The real difference is whose side they are on. A forward proxy represents the clients; a reverse proxy represents the servers.
This page puts the two side by side, shows the same request through each, and gives a decision table. For the full story of each, read Forward Proxy and Reverse Proxy.
1. What Are Forward and Reverse Proxies?
A forward proxy is deployed by the client side, such as a company or a user, and forwards outbound requests to any destination on their behalf.
A reverse proxy is deployed by the server side, the owner of a website or API, and receives inbound requests for its own servers.
A quick test: if the proxy can reach many unknown sites for known users, it is a forward proxy. If it serves many unknown users for known servers, it is a reverse proxy.
2. Architecture Comparison
3. The Same Request Through Each Proxy
Through a forward proxy
- An employee's browser is configured with
proxy.corp.example:3128. - It requests
https://news.example.orgby sendingCONNECT news.example.org:443to the proxy. - The proxy checks company policy, opens the tunnel, and the news site sees the company's proxy IP.
Through a reverse proxy
- A visitor types
https://shop.example.com; DNS points to the shop's reverse proxy. - The proxy terminates TLS, picks a healthy app server and forwards the request.
- The visitor never learns the app server's address.
Notice who configures what. With a forward proxy, the client must point at the proxy. With a reverse proxy, the client does nothing; DNS points at the proxy.
Both proxies can keep logs, but only the forward proxy sees every site a user visits. That is why forward proxy logs need strict access control and short retention.
What each party can see
- The forward proxy sees the user (if authenticated), every destination hostname, timing and data volume. With HTTPS it does not see paths or content.
- The reverse proxy sees the full decrypted request for its own site, including path, headers, cookies and body, but nothing about the user's other browsing.
- The website sees the forward proxy's IP address, not the user's, unless the proxy forwards it in a header.
- The user sees only the reverse proxy's address, never the backend servers.
4. Key Differences Explained
- Protected party: forward hides clients from servers; reverse hides servers from clients.
- Owner: forward proxies belong to the client's organisation; reverse proxies belong to the service owner.
- Destinations: forward proxies reach any site that policy allows; reverse proxies reach only their configured backends.
- TLS: a forward proxy usually tunnels HTTPS without decrypting it; a reverse proxy usually terminates TLS with the site certificate.
- Typical features: forward focuses on filtering, logging and egress control; reverse focuses on load balancing, caching and security.
Common misconceptions
- "The software decides the type." It does not. Nginx, Envoy and even Squid can be configured as either; the deployment and the owner decide the role.
- "A forward proxy makes browsing secure." It controls and logs traffic, but it does not encrypt anything. HTTPS provides the encryption.
- "Only large companies need a reverse proxy." Even a single server benefits from TLS termination, compression and hiding the application port.
- "Clients can always see the reverse proxy." They cannot. To the client, the reverse proxy simply is the website.
5. Practical Implementation
The configurations show the different perspective. The forward proxy (Squid) lists who may use it. The reverse proxy (Nginx) lists which servers it fronts.
http_port 3128
acl office src 10.20.0.0/16
acl CONNECT method CONNECT
acl SSL_ports port 443
http_access deny CONNECT !SSL_ports
http_access allow office
http_access deny all
upstream shop_backend {
server 10.0.1.11:8080;
server 10.0.1.12:8080;
}
server {
listen 443 ssl;
server_name shop.example.com;
ssl_certificate /etc/nginx/certs/shop.crt;
ssl_certificate_key /etc/nginx/certs/shop.key;
location / {
proxy_pass http://shop_backend;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# Forward proxy: the client must opt in
curl -x http://proxy.corp.example:3128 https://news.example.org/
# Reverse proxy: the client just calls the public name
curl https://shop.example.com/
6. Advantages and Disadvantages
| Forward proxy | Reverse proxy | |
|---|---|---|
| Main benefit | Control and visibility of outbound traffic | Protection, scaling and speed for services |
| Extra benefit | Shared caching, fixed egress IP | TLS in one place, caching, load balancing |
| Main drawback | Clients need configuration | Must be highly available |
| Risk if misconfigured | Open proxy abused by attackers | Spoofed headers or exposed backends |
7. Forward Proxy vs Reverse Proxy Comparison
| Aspect | Forward proxy | Reverse proxy |
|---|---|---|
| Acts on behalf of | Clients | Servers |
| Hides | Client identity | Server identity and topology |
| Configured by | Client or network admin | Service owner (DNS points to it) |
| Traffic direction | Outbound (inside to outside) | Inbound (outside to inside) |
| TLS handling | Usually tunnels with CONNECT | Usually terminates TLS |
| Common tools | Squid, corporate secure web gateways | Nginx, HAProxy, Envoy, Traefik |
| Typical uses | Filtering, auditing, egress control | Load balancing, caching, security |
8. Real-World Use Cases
- Both in one request: an employee behind a corporate forward proxy visits a site that runs behind a reverse proxy. The request passes through both, and neither side sees the other's internals.
- Microservices: an ingress reverse proxy handles inbound traffic, while an egress forward proxy controls calls to third-party APIs.
- Developer tools: local debugging proxies such as mitmproxy act as forward proxies; local dev servers often use a reverse proxy to combine front end and API on one origin.
When you draw an architecture, place forward proxies on the client's side of the boundary and reverse proxies on the service's side. That single rule removes most of the confusion in design reviews.
Example: ingress and egress around one service
Consider a payment service running in Kubernetes. Customer requests arrive through an ingress controller, the reverse proxy, which terminates TLS and routes /pay to the service. When the service calls the card network's API, the request leaves through an egress proxy, the forward proxy, which allows only that partner's hostname and gives the partner one fixed IP address to allow-list. The same service therefore sits between two proxies, each guarding a different boundary.
9. Best Practices
- Name them by role: state "egress proxy" or "ingress proxy" in architecture docs to avoid confusion.
- Forward proxies: restrict who can use them, allow CONNECT only to port 443, and protect browsing logs.
- Reverse proxies: run redundant instances, block direct access to backends, and set forwarded headers correctly.
- Do not mix roles on one instance unless the rules are clearly separated; an exposed forward-proxy rule on a public reverse proxy creates an open proxy.
Finally, monitor both. For a forward proxy, watch blocked requests and unusual destinations, which can reveal malware. For a reverse proxy, watch error rates, latency and traffic per backend, which reveal failing or overloaded services.
10. Summary
- Both proxies sit in the middle; the difference is whom they represent.
- Forward proxy: client-side, outbound, hides users, configured by clients.
- Reverse proxy: server-side, inbound, hides servers, reached through DNS.
- Forward proxies tunnel HTTPS; reverse proxies usually terminate it.
- Real systems often use both: egress proxies and ingress proxies.
A VPN also routes traffic through a middle server. See how it differs in Forward Proxy vs VPN.
Forward Proxy vs Reverse Proxy: Top Interview Questions
These are the forward and reverse proxy questions most often asked in system design interviews, with short answers you can explain in your own words.
Q1. What is the key difference between a forward proxy and a reverse proxy?
Whose side it is on. A forward proxy is run for the users and sends their requests out to any site, so websites see the proxy instead of the user. A reverse proxy is run by the site owner and receives requests for its own servers, so users see the proxy instead of the servers.
Q2. Does the client need to know about the proxy?
For a forward proxy, yes: the client or network must be configured to use it, unless it is transparent. For a reverse proxy, no: DNS points the site name at the proxy, and the client cannot tell that it is a proxy.
Q3. Can one request pass through a forward proxy and a reverse proxy at the same time?
It often does. A user's request leaves through their company's forward proxy and arrives at the website's reverse proxy. Each proxy protects its own side.
Q4. Which one terminates TLS?
Usually the reverse proxy, because it holds the website's certificate. A forward proxy normally tunnels HTTPS with CONNECT and cannot read it, unless TLS inspection is deliberately set up.