代理充当请求的中介。正向代理位于客户端前面(代表它们面向服务器),而反向代理位于服务器前面(代表它们面向客户端)——处理负载均衡、缓存、安全性等。反向代理是关键的系统设计组件。
正向代理 vs 反向代理
text
FORWARD PROXY → sits in front of CLIENTS, forwarding their requests to servers:
Client → FORWARD PROXY → Internet/Server
→ represents the CLIENT (hides client identity); for filtering, caching, anonymity,
access control (e.g. corporate proxies)
REVERSE PROXY → sits in front of SERVERS, receiving requests on their behalf:
Client → REVERSE PROXY → Backend servers
→ represents the SERVERS (clients don't see the backend); the common system-design component
