Forward proxy versus reverse proxy: what is the difference?
BeginnerScenarioLoad Balancing, Proxies & CDN
Answer
Situation read → They sit on opposite sides of the connection.
What I'd do →
- A forward proxy (Squid, corporate proxy) sits in front of clients and controls their outbound access, for example
HTTPS_PROXY=http://proxy:3128 - A reverse proxy (Nginx, Envoy, ALB) sits in front of servers, hiding them and handling TLS, caching and routing
- Test a forward proxy with
curl -x http://proxy:3128 https://example.com - Reverse proxy sits at the public edge of your apps
Why → A forward proxy represents clients to the world; a reverse proxy represents servers to the world.
Interview tip → Mention that service meshes are reverse proxies in sidecar form.
More on Load Balancing, Proxies & CDN
What is the difference between a Layer 4 and a Layer 7 load balancer?BeginnerWhen do you choose an ALB and when an NLB in AWS?BeginnerHow do health checks work on a load balancer and what makes a good one?BeginnerWhat are sticky sessions and why would you avoid them?BeginnerWhat does a CDN do and when does it help?BeginnerYour app sees the load balancer's IP instead of the real client IP. How do you get the real one?Beginner