What is a Reverse Proxy?
A reverse proxy sits between clients and your backend servers, forwarding requests and returning responses. It's called "reverse" because clients don't know they're talking to a proxy — they think they're communicating directly with the server.
The Gateway Mental Model
Think of Nginx as a smart receptionist at a large company. When visitors (requests) arrive, the receptionist checks their purpose and directs them to the right department (backend server), without the visitor needing to know the building's internal layout.
Forward Proxy vs Reverse Proxy
Forward Proxy
Sits in front of clients. The server doesn't know who the real client is.
Example: VPN, corporate firewall, privacy proxy
Reverse Proxy
Sits in front of servers. The client doesn't know which server responds.
Example: Nginx, HAProxy, AWS ALB
Why Use a Reverse Proxy?
Load Balancing
Distribute traffic across multiple backend servers for better performance and reliability
SSL Termination
Handle HTTPS encryption at the proxy, simplifying backend server configuration
Caching
Cache responses to reduce backend load and improve response times
Security
Hide backend infrastructure, add rate limiting, and filter malicious requests
Compression
Compress responses to reduce bandwidth and improve load times
Logging
Centralized access logging and monitoring for all services
Why Nginx?
Nginx (pronounced "engine-x") is one of the most popular web servers and reverse proxies, powering over 30% of the top websites worldwide.
Performance
- • Event-driven, non-blocking architecture
- • Handles 10,000+ concurrent connections
- • Minimal memory footprint
- • Fast static file serving
Flexibility
- • HTTP, TCP, UDP proxying
- • WebSocket support
- • Modular configuration
- • Rich ecosystem of modules
Try It: Send a Request Through Nginx
Click the button below to simulate sending a request through the reverse proxy. Watch how Nginx receives it and forwards it to the backend.
Now that you understand the purpose of a reverse proxy, let's dive into how Nginx actually works under the hood.