Home/Glossary/Reverse Proxy

Reverse Proxy

A server that sits in front of backend servers, forwarding client requests and returning responses while hiding the origin server's identity.

Web SecurityAlso called: "reverse proxy server", "edge proxy", "proxy server"

Reverse proxies enhance security, performance, and reliability by acting as an intermediary between clients and backend infrastructure.

Why it matters

  • Protects backend servers from direct exposure to the Internet.
  • Enables SSL/TLS termination, offloading encryption overhead from application servers.
  • Provides caching to reduce backend load and improve response times.
  • Facilitates zero-downtime deployments and blue-green releases.
  • Essential for web application security and DDoS mitigation.

Key capabilities

  • SSL termination: Decrypt HTTPS traffic at the proxy, simplifying certificate management.
  • Caching: Store static content and API responses to reduce backend requests.
  • Compression: Gzip or Brotli compress responses to reduce bandwidth.
  • Request routing: Direct traffic to different backends based on URL path or headers.
  • Load balancing: Distribute requests across multiple backend servers.
  • Request/response modification: Add headers, rewrite URLs, or transform content.

Security benefits

  • Origin hiding: Backend servers are not directly addressable from the Internet.
  • Web Application Firewall (WAF): Inspect and filter malicious requests.
  • Rate limiting: Prevent abuse and brute-force attacks at the edge.
  • DDoS protection: Absorb attack traffic before it reaches backends.
  • Security headers: Inject CSP, HSTS, X-Frame-Options, and other protective headers.

Forward proxy vs reverse proxy

  • Forward proxy: Sits in front of clients, forwarding requests to the Internet (e.g., corporate proxy, VPN).
  • Reverse proxy: Sits in front of servers, receiving requests from the Internet (e.g., Nginx, Cloudflare).

Common implementations

  • Web servers: Nginx, Apache, Caddy.
  • CDNs: Cloudflare, Fastly, Akamai, AWS CloudFront.
  • Application delivery: HAProxy, Traefik, Envoy.
  • Cloud services: AWS ALB, Azure Application Gateway.

Configuration best practices

  • Enable HTTP Strict Transport Security (HSTS) to enforce HTTPS.
  • Set appropriate timeouts to prevent slow-loris attacks.
  • Configure connection pooling to backend servers for efficiency.
  • Implement health checks to route traffic away from failing backends.
  • Log all requests for security analysis and troubleshooting.