Interview knowledge

Forward proxy vs Reverse proxy vs API Gateway

Establishedest.Started 17 Aug 20261 min read#engineering#system-design

Forward proxy Reverse proxy API Gatewayin the trade-off explorer →

Where it sits: API gateway

Forward proxy: next to the client before reaching internet
Reverse proxy: server side to go to the right server
API gateway: reverse proxy that does more than routing. it handles auth, rate limiting and other things before going to the right API

Pasted image 20260817115438.png

A forward proxy sits next to the client. Your laptop sends a request, the proxy forwards it out, and the destination never sees your real IP. Corporate networks use this to enforce policy, block sites, and cache traffic.

A Reverse proxy sits next to the server. The client has no idea how many machines are behind it. The proxy decides who handles the request, terminates TLS, and keeps your backend off the public internet. NGINX and HAProxy are commonly used here, typically paired with a Load Balancer in front.

An API gateway is a reverse proxy that does more than route traffic. It also handles auth, rate limits, API keys, versioning, and request shaping. Without it, each microservice has to implement its own version of validation, throttling logic, and request logging.

A forward proxy represents the client, a reverse proxy represents the server, and an API gateway is what you add when ten services need the same authentication and rate limiting rules applied consistently.

In most real systems, all three are running at different layers. The forward proxy filters outbound traffic, the reverse proxy fronts the application servers, and the API gateway sits in front of your APIs to enforce policies before requests reach them.