Interview Prep/DevOps Fundamentals/Networking basics for DevOps

What is the difference between a forward proxy and a reverse proxy?

BeginnerConceptNetworking basics for DevOps
Answer

In one line: A forward proxy sits in front of clients and makes requests to the internet on their behalf; a reverse proxy sits in front of servers and receives requests from the internet on their behalf.

Forward proxy (client side)

Users ──> Forward proxy ──> Internet websites
  • The client knows it's using the proxy; the website sees the proxy's IP, not the user's.
  • Uses:
    • Corporate internet access control and filtering.
    • Caching common downloads.
    • Controlling outbound traffic from servers (an egress proxy, so servers can only reach approved sites).
    • Privacy (hiding client IPs).
  • Examples: Squid, corporate proxies; build agents often use HTTP_PROXY/HTTPS_PROXY settings.

Reverse proxy (server side)

Internet users ──> Reverse proxy ──> Backend servers
  • The client usually doesn't know there are multiple servers behind it.
  • Uses:
    • Load balancing across backends.
    • TLS termination (handles HTTPS certificates).
    • Routing — /api to one service, / to another.
    • Caching and compression.
    • Security — hides backend servers, adds WAF rules, rate limiting.
  • Examples: Nginx, HAProxy, Envoy, Traefik, AWS ALB, Azure Application Gateway, Cloudflare, Kubernetes Ingress controllers.

Example Nginx reverse proxy:

server {
  listen 443 ssl;
  server_name shop.example.com;
  location /api/ { proxy_pass http://api_backend; }
  location /     { proxy_pass http://frontend; }
}
Forward proxy Reverse proxy
Sits in front of Clients Servers
Acts on behalf of The user The website/service
Typical use Filtering, egress control Load balancing, TLS, routing

Tip for interviews: use a simple sentence: "forward proxy protects and controls clients; reverse proxy protects and scales servers" — then give Nginx or an Ingress controller as an example.

All DevOps Fundamentals questions

More on Networking basics for DevOps