A Reverse Proxy is an intermediary proxy server that sits between external clients and internal backend origin servers. To external clients, the reverse proxy appears as the origin server itself, intercepting all inbound requests before routing them to internal microservices.
graph LR
subgraph Public Internet
Client1([Web Browser]) --> Proxy[Reverse Proxy<br/>Nginx / Envoy / ALB]
Client2([Mobile App]) --> Proxy
end
subgraph Private VPC Network
Proxy --> ServiceA[Auth Service :8001]
Proxy --> ServiceB[Catalog Service :8002]
Proxy --> ServiceC[Billing Service :8003]
end
style Proxy fill:#2563eb,stroke:#1d4ed8,color:#fff
1. Forward Proxy vs Reverse Proxy
Dimension
Forward Proxy
Reverse Proxy
Who it protects / represents
The Client (Hides client identity from internet)
The Server (Hides backend architecture from clients)
Because the backend server sees the reverse proxy’s private IP as the TCP client address, the proxy must preserve client metadata using standard HTTP headers:
X-Forwarded-For: A comma-separated list of IP addresses representing the client and intermediate proxies:
X-Forwarded-For: 203.0.113.195, 198.51.100.10
(Security Rule: Only trust the leftmost IP if your proxy is configured to strip or overwrite incoming client-provided X-Forwarded-For headers!)
X-Forwarded-Proto: Indicates whether the client connected via http or https.
X-Forwarded-Host: The original Host header requested by the browser.
RFC 7239 Forwarded: The consolidated IETF standard: