What is a reverse proxy?

In short
A reverse proxy is a server that sits in front of one or more other servers and forwards client requests to them. Clients talk only to the reverse proxy, which then passes each request to the right backend server and returns the answer. It is often used for load balancing, buffering and hiding internal servers.
A reverse proxy is a server that stands between clients and your real application servers. A client, such as a web browser, sends its request to the reverse proxy. The proxy then forwards that request to another server, waits for the answer, and sends it back to the client. From the client's point of view, the proxy is the website.
The name is set against a normal, or forward, proxy. A forward proxy acts for the client, for example inside a company network that routes all web traffic through one gateway. A reverse proxy acts for the server. The client usually does not know it exists.
How it works
When a request arrives, the reverse proxy looks at it and decides where it should go. It opens a connection to the chosen backend, sends the request, reads the response, and relays it to the client. Many proxies also keep the response in a buffer while it is being sent, so a slow client does not hold a backend connection open.
The NGINX proxy module works this way. You tell it where to send requests with the proxy_pass directive. A minimal setup looks like this:
location / { proxy_pass http://localhost:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; }
This block sends every request for the root path to a server running on port 8000 on the same machine. The proxy_set_header lines pass the original host name and the client's IP address on to that backend, because the backend would otherwise only see the proxy's address.
When to use it
Reverse proxies are common in front of web applications. They let one public address serve several internal services, each running on its own port or machine. They can also terminate TLS, which means the proxy handles HTTPS encryption so the application servers do not have to.
Buffering is another reason. The NGINX documentation describes how responses are first read into memory buffers, and a part can be written to a temporary file on disk if the response is large. This lets the proxy read a response quickly and then send it to a slow client at its own pace. Buffering is on by default and can be turned off with proxy_buffering off when you need data to flow straight through, for example for streaming.
Caching is a related feature. The same module can store responses so that repeated requests are answered without contacting the backend again. Caching needs a shared memory zone and a cache path, and it is worth reading the cache settings carefully before you enable it.
Common mistakes
A frequent mistake is forgetting to pass the original Host header. Many applications use it to choose which site to show, so a missing header can lead to wrong pages or redirects. Another is assuming the backend sees the real client address. Without headers such as X-Real-IP, it sees only the proxy.
Buffer sizes also matter. The documentation says that if the response header part is larger than the proxy_buffer_size, the response is treated as invalid. If your application sends large headers, increase this size rather than guessing.
Finally, remember that the proxy is now a single point that all traffic passes through. If it stops, the whole site goes down, so plan for monitoring and, in larger systems, more than one proxy.
Alternatives
A reverse proxy is not the only way to route traffic. A load balancer is often a reverse proxy with extra features for spreading traffic across many identical servers. Some teams use an API gateway, which adds authentication and rate limits on top of routing. For a single small application, a plain web server with a proxy rule is often enough.
If you are new to web servers, you may want to read our guides on HTTP basics and on load balancing before choosing a tool.
FAQ
Is a reverse proxy the same as a load balancer?
Not exactly. A load balancer spreads requests across several identical servers, and many load balancers are built as reverse proxies. A reverse proxy can also do caching, TLS handling and routing to different services.
Does the user know they are talking to a reverse proxy?
Usually not. The client connects to a normal address and receives normal responses. Only the server side sees the extra hop, which is why headers like Host and X-Real-IP are often passed on.
Why would I turn off proxy buffering?
Turn buffering off when you need the response to pass to the client as soon as each part arrives, such as for streamed data. With buffering on, the proxy stores the response first and then sends it.
Can a reverse proxy make my site faster?
It can, mainly through caching and by letting slow clients read from buffers instead of tying up your application. The gain depends on your traffic and how you configure it.
Sources
This page is based on the official documentation below. Read it for full detail.
Reverse proxy — official documentation ↗Reverse proxy in the news
Docker VMM Reaches General Availability in Docker Desktop 4.101
Docker has made Docker VMM generally available in Docker Desktop 4.101 for macOS, Windows and Linux. The company also published fixed Docker Hardened Images for Java4Shell and NGINX HTTP/2.
Five nginx flaws enable crashes and code execution; Cloudflare says its proxy blocks the HTTP/2 and HTTP/3 paths
F5 disclosed ten nginx vulnerabilities on November 18, 2026, including five memory corruption bugs from the nginx2root research. Proxied origins are shielded from several HTTP/2 and HTTP/3 attacks, but not from all of them.

