Core Functions
A reverse proxy sits between clients and upstream servers, providing: TLS termination, request routing, upstream connection pooling, response caching, compression, rate limiting, and DDoS mitigation.
TLS Termination
The proxy decrypts incoming TLS and forwards plain HTTP to upstreams. Certificates rotate without downtime via SNI — multiple certs loaded simultaneously; the correct one selected per hostname at handshake time.
HTTP/2 to HTTP/1.1 Translation
Client HTTP/2 streams are multiplexed over a single connection. The proxy fans these out to upstream HTTP/1.1 connections drawn from a per-upstream pool, bridging protocol versions transparently.
Connection Pool
Per-upstream pool:
max_connections = 100
idle_timeout = 60s
health_check = TCP connect every 10s on idle connections
Connection reuse eliminates per-request TCP and TLS handshake overhead to upstreams.
Request Buffering
The proxy buffers the complete request body before forwarding to the upstream. This decouples slow clients from upstream workers, preventing slow-loris-style resource exhaustion.
Response Streaming
Large responses are streamed directly to the client without full buffering at the proxy, reducing Time to First Byte (TTFB) and memory pressure.
Compression
Gzip and Brotli compression applied when the client sends Accept-Encoding and the response content type is compressible (text/html, application/json, etc.). Skipped for already-compressed formats (images, video).
DDoS Mitigation
- Rate limit by IP + User-Agent combination.
- Redirect suspicious traffic to a CAPTCHA challenge page.
- Block known bad IPs via a continuously updated IP blocklist.
Header Manipulation
The proxy can add, remove, or rewrite both request headers (before forwarding) and response headers (before returning to client). Common uses: inject X-Request-ID, strip internal headers, set Strict-Transport-Security.
Web Application Firewall
Requests are inspected for SQLi, XSS, and other OWASP Top 10 patterns before forwarding. Matched requests are blocked or flagged for logging.
See also: Scale AI Interview Guide 2026: Data Infrastructure, RLHF Pipelines, and ML Engineering
See also: Anthropic Interview Guide 2026: Process, Questions, and AI Safety