What is a reverse proxy and when to use one
· Category: Networking
Short answer
A reverse proxy sits in front of web servers and forwards client requests to backend services. It hides the origin infrastructure, caches content, and handles SSL termination.
How it works
Clients connect to the reverse proxy, which then fetches content from one or more backend servers. The proxy can modify headers, compress responses, cache static assets, and distribute requests across multiple servers. Backend servers never communicate directly with clients.
Example
NGINX configured as a reverse proxy receives requests on port 443, terminates TLS, and forwards them to an internal Node.js application on port 3000. It also caches images and CSS files to reduce backend load.
Why it matters
Reverse proxies add a protective layer, simplify certificate management, and enable horizontal scaling. They also allow A/B testing and blue-green deployments by routing traffic to different backend versions dynamically.