A reverse proxy is a server that sits in front of one or more backend servers and forwards client requests to them. The client talks to the proxy, the proxy talks to the backend, and the client never connects to the backend directly. This guide answers what is a reverse proxy in plain terms, explains what Nginx adds when it plays that role, and helps you decide when a reverse proxy is the right tool for your setup.
The idea is easier to see with a simple case. A small app runs on port 3000 on your server, but visitors expect a normal website on port 443 with a domain name and a certificate. A reverse proxy listens on 443, terminates TLS, and forwards each request to the app on port 3000. The app itself never handles certificates, never listens on a public port, and can be restarted or moved without changing the public address.
Reverse Proxy vs Forward Proxy
The names sound alike but the direction is opposite. A forward proxy sits near the client and forwards the client’s requests out to the internet, often to enforce policy or hide the client’s address. A reverse proxy sits near the server and forwards incoming requests in to backends, often to hide the backends and to add shared services in front of them.
The practical difference is who configures it. A forward proxy is configured on the client side, such as a company laptop sending traffic through a corporate proxy. A reverse proxy is configured on the server side, and visitors never know it is there. When people say “proxy” about a web server setup, they almost always mean a reverse proxy.
What Nginx Adds as a Reverse Proxy
Nginx as a reverse proxy adds several services in one place. It terminates TLS, so backends do not each need certificate handling. It can serve static files directly, which takes load off an app server that is slower at file delivery. It can cache responses, compress them, and add security headers, all in one config, for every backend behind it.
A full nginx reverse proxy setup adds TLS, routing, and headers in one place. It also adds routing. One Nginx instance can send /api/ to an API server, /app/ to a web app, and everything else to a static site, based on the path or the domain. That routing is what lets a team run several services behind one domain and one certificate. Our guide to configuring Nginx as a reverse proxy for Docker containers shows the container version of this pattern, and the beginner reverse proxy tutorial walks through the basic proxy pass setup.
Load balancing is another reason to put Nginx in front. With an upstream block listing several backends, Nginx spreads requests across them, and if one backend stops responding, Nginx can stop sending it traffic. That only helps when the app itself can run on several backends, which is true for stateless services but needs session handling work for stateful ones.
What Is a Reverse Proxy Good For in Practice?
Deciding when to use reverse proxy support comes down to whether backends should face the internet directly. Use a reverse proxy when you have an app that should not face the internet directly, when several services share one domain or one certificate, or when you want caching, TLS, and headers handled once instead of once per app. It is the right default for a Docker host with several containers, for a Node or Python app behind a domain, and for any setup where the public address should stay stable while backends change.
Skip it when there is only one static site and no backend at all. Nginx can serve that site directly without any proxying, and adding a proxy layer adds a hop for no benefit. Also skip it as a substitute for application security: a reverse proxy can add headers and rate limits, but it does not fix an app that trusts user input blindly or stores passwords badly.
A related decision is which proxy tool to use. Nginx is a strong default when you already run it or want fine control in config files. A panel tool can be easier when many non-technical users manage sites, and Traefik fits Docker setups that want automatic routing from container labels. Our Traefik versus Nginx Proxy Manager comparison and the Cloudflare Tunnel versus proxy manager comparison lay out those trade-offs side by side.
Common Reverse Proxy Problems
The most common problem is a backend that sees the proxy’s address instead of the visitor’s address. Fix it by forwarding the real IP headers from Nginx and configuring the backend to trust them, otherwise logs and rate limits will treat all visitors as one client.
The second problem is a redirect loop, where the backend thinks the request arrived over HTTP and redirects to HTTPS, while the proxy already terminated TLS. This usually comes from a missing forwarded-proto header or a backend setting that does not trust the proxy. Set the forwarded headers and tell the backend it sits behind a proxy, and the loop clears.
The third problem is caching a response that should not be cached, such as a logged-in page served to the wrong user. Keep caching off for authenticated paths and test with two different sessions before enabling a cache on a dynamic app. Our Nginx caching guide explains which cache type fits which situation and where the boundaries belong.
A reverse proxy is a simple idea with a large payoff: one public front door, many backends behind it, and shared services handled once. Start with Nginx in front of a single app, learn the proxy pass and header settings on that small setup, and the pattern scales to a whole server of services without changing the model.