Lesson 9 of 17
7. Load Balancers, Reverse Proxies and API Gateways

7.8 What's the difference between a forward proxy and a reverse proxy?

3 min read+10 XP

Beyond load balancing

At the airport: A travel agent books flights on behalf of passengers: the airline sees the agent, not you. An airline's head office answers all customer calls on behalf of its many departments: you talk to one number, not to each department.

In the system: A proxy is a middleman that forwards requests. The difference is whose side it's on.

  • A forward proxy sits in front of clients. Office laptops send all web traffic through it; it can filter sites, cache, log, and hide the clients' addresses. Websites see the proxy, not the individual user.
  • A reverse proxy sits in front of servers. Clients talk to it as if it were the server; it forwards to the real servers behind. It can load-balance, terminate TLS, cache responses, compress, and hide the servers' addresses.

A load balancer is a reverse proxy whose main job is spreading load. Tools like NGINX, HAProxy and Envoy can play any of these roles depending on how they're configured.

Memory code: "Forward proxy speaks for the clients; reverse proxy speaks for the servers."