What Is Reverse Proxy?
Reverse Proxy Server
A reverse proxy sits between clients and backend servers, forwarding requests to the appropriate server and returning the response. It handles SSL termination, caching, load balancing, and security — hiding your backend infrastructure from the public internet.
How Reverse Proxy Works
Nginx and Caddy are the most popular reverse proxies. They receive incoming requests on port 443 (HTTPS), terminate SSL, and forward requests to your application running on an internal port (3000, 8080). They also serve static files, cache responses, and implement rate limiting.
Key Concepts
- SSL Termination — Handling HTTPS at the proxy level so backend servers communicate over plain HTTP internally
- Request Routing — Directing requests to different backend services based on URL path — /api to the API server, / to the frontend
- Caching — Storing responses so repeated requests are served directly from the proxy without hitting the backend
Frequently Asked Questions
What is the difference between a reverse proxy and a load balancer?
A load balancer distributes traffic across multiple servers. A reverse proxy adds features like SSL termination, caching, and routing. In practice, tools like Nginx do both. They're complementary, not competing concepts.
Do I need a reverse proxy?
In production, yes. Nginx or Caddy handles HTTPS, serves static files, and protects your application server from direct internet exposure. In development, your framework's dev server is sufficient.