Forward proxy vs reverse proxy: what is the difference?
By the ProxyOnly team · 14 Nov 2026 · 5 min read
A forward proxy sits in front of clients, a reverse proxy sits in front of servers. What each does, with examples and a working nginx config.
A forward proxy sits in front of clients and makes requests to the internet for them. A reverse proxy sits in front of servers and receives requests from the internet for them. The mechanism is the same, an intermediary that relays requests, but it faces the opposite way.
When people in scraping, testing or privacy circles say "proxy" they mean a forward proxy. When system administrators say it, they often mean a reverse proxy such as nginx. This article explains both, shows a working reverse proxy configuration, and gives a quick way to tell which one you are dealing with.
The one-line difference
A forward proxy hides the client from the server. A reverse proxy hides the server from the client.
Forward proxy: acts for clients
A forward proxy is something the client chooses to use, or that its network forces on it. You enter the proxy's host and port into a browser or script, and your requests go there first. The website sees the proxy's IP address, not yours.
Forward proxies are used to:
- hide the client's IP address and choose its apparent country
- filter or block sites on a company or school network
- cache responses to save bandwidth
- spread many requests over many addresses, as in web scraping and testing
Squid is the best-known open source forward proxy, and it listens on port 3128 by default. Proxy services such as the ones ProxyOnly sells are also forward proxies, usually with a gateway in front of a pool of addresses. See what is a proxy server for the basics.
Reverse proxy: acts for servers
A reverse proxy is something the website owner puts in front of their servers. Visitors connect to it without knowing it is there, and it passes each request to the right server behind it. The visitor never sees the real servers' addresses.
Reverse proxies are used to:
- spread traffic over several servers, which is load balancing
- terminate TLS, so the application servers do not need to handle encryption
- cache and compress responses
- apply rate limits and filter attacks, as a web application firewall does
- route several applications that share one domain name
nginx, HAProxy, Envoy, Caddy and Traefik are common reverse proxies, and content delivery networks such as Cloudflare and Fastly work as reverse proxies for the sites they serve.
Here is a minimal nginx reverse proxy that passes requests to an application listening on port 3000. The directives are documented in the nginx proxy module reference:
server {
listen 80;
server_name app.example.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}The proxy_set_header lines matter. Behind a reverse proxy the application sees the proxy as the client, so it relies on these headers to learn the visitor's real address and whether the visitor used HTTPS.
Side by side
- Sits in front of: clients for a forward proxy, servers for a reverse proxy.
- Configured by: the client or the client's network, versus the website owner.
- Who knows about it: the client usually does, versus the visitor usually not.
- Hides: the client's address from the server, versus the servers' details from the client.
- Typical goals: privacy, location, filtering and caching, versus scale, security and performance.
- Typical software: Squid and commercial proxy services, versus nginx, HAProxy and CDNs.
How to tell which one you have
If you typed a proxy host and port into a tool, it is a forward proxy.
If you are looking at a website and want to know whether a reverse proxy is in front of it, the response headers often show it. Run the following and look for headers such as Server, Via, or vendor headers like CF-RAY that identify a CDN:
curl -sI https://example.comAt the time of writing, that request returns lines such as these, which show a content delivery network in front of the site:
server: cloudflare
cf-ray: a5a880c769305329-AMS
cf-cache-status: HITA reverse proxy does not always announce itself, so the absence of these headers proves nothing.
Can one be both?
The software can. nginx can forward requests to a backend as a reverse proxy, and Squid can sit in front of a web server as a reverse proxy as well as serving as a forward proxy for a network. What decides the label is which side of the connection it is acting for in a particular setup.
A third term you will meet is a transparent proxy, which is a forward proxy that a network applies without the client configuring anything. It has a second meaning in proxy lists, covered in transparent, anonymous and elite proxies.
Reverse proxy, load balancer, API gateway and CDN
These terms overlap, and the name people use depends mostly on the product they bought rather than on a different mechanism. A load balancer spreads requests over several servers and is often a feature of a reverse proxy. An API gateway is a reverse proxy specialised for APIs, adding authentication, quotas and request rewriting. A content delivery network is a set of reverse proxies in many locations that cache content close to visitors.
What each can see
There is one real asymmetry worth knowing. A reverse proxy that terminates TLS holds the website's certificate, so it sees requests in plain form, which is how it can cache, filter and rate limit them. A forward proxy handling HTTPS usually only tunnels encrypted bytes with CONNECT, so it sees the destination host and nothing inside the connection.
Common mistakes with reverse proxies
- Trusting
X-Forwarded-Forfrom anyone. Any client can send that header, so an application should only trust it when the request came from its own reverse proxy. Frameworks have a setting for this, such astrust proxyin Express. - Forgetting to forward
HostandX-Forwarded-Proto. The usual symptom is a redirect loop or links that point tohttp://instead ofhttps://. - Logging the proxy's address as the visitor. Logs and rate limits should use the real client address taken from a trusted header.
Which one do you need?
If you want to change where your requests appear to come from, to test a site from another country, or to collect public data at volume, you want a forward proxy. Choosing the right proxy type covers the next decision, which is the kind of IP address.
If you run a website and want it faster, safer or spread across servers, you want a reverse proxy.
Try it yourself
Create an account, add funds from US$1 and order a proxy in the country you need.
Keep reading
25 Nov 2026 · Proxy basics
IP whitelisting (allowlisting) explained, and how static proxies help
IP allowlisting restricts access to a known set of addresses. Why it keeps breaking when your own address changes, and the fixes that actually hold.
25 Nov 2026 · Proxy basics
Buying IPv6 proxies: when they work and when they do not
IPv6 proxies cost a fraction of IPv4 because they only reach sites that publish an IPv6 address. How to check your targets before you spend anything.