Documentation Python quickstart Blog Free tools Enterprise solutions hello@quanticdata.ioLog in

Forward proxy vs reverse proxy: the difference, with both run for real

The path of a request through a forward proxy and a reverse proxy: the client sets the forward proxy, the site sees the proxy IP, the site owner sets the reverse proxy, and two origin servers A and B stay hidden behind it; the card sums up who each proxy works for and that 6 test requests were split 3 and 3.
The path of a request through a forward proxy and a reverse proxy: the client sets the forward proxy, the site sees the proxy IP, the site owner sets the reverse proxy, and two origin servers A and B stay hidden behind it; the card sums up who each proxy works for and that 6 test requests were split 3 and 3.

A forward proxy sits in front of clients: you point your browser or script at it, it makes the request for you, and the website sees the proxy's IP address. A reverse proxy sits in front of servers: the site's owner sets it up, visitors connect to it without knowing, and it passes each request to a server behind it.

The two are the same kind of program doing the same job, relaying HTTP, for opposite sides. To make the difference concrete we ran one of each on 20 November 2026: a QuanticData mobile proxy line as the forward proxy, and a 26-line Node.js script as the reverse proxy. Everything below is the real output, with public IP addresses masked.

Forward proxy vs reverse proxy at a glance

Forward proxyReverse proxy
Works forThe clientThe server
Who sets it upThe user, in the browser, the system or the codeThe site owner, in front of the web servers
Who knows it is thereThe client (it is configured there)The servers behind it; the visitor just sees "the site"
What it hidesThe client's IP address from the siteThe origin servers from the visitor
In our testA mobile proxy line: the echo site saw a T-Mobile USA address instead of oursA Node.js script on port 9100: 6 requests shared between 2 origin servers
Typical usesSeeing a site as a visitor in another country, ad verification, price monitoring, a company's single exit to the internetLoad balancing, TLS termination, caching, one public address for many services

A forward proxy, run for real

A forward proxy is configured on the client. With curl that is the -x option. We asked httpbin.org, a service that echoes the request it receives, for the same URL twice: once directly and once through one of our US mobile proxy lines.

curl https://httpbin.org/anything/hello
{
  "headers": {
    "Accept": "*/*",
    "Host": "httpbin.org",
    "User-Agent": "curl/8.21.0"
  },
  "method": "GET",
  "origin": "x.x.x.x",
  "url": "https://httpbin.org/anything/hello"
}

curl -x http://USER:PASS@mobile.quanticdata.io:8080 https://httpbin.org/anything/hello
{
  "headers": {
    "Accept": "*/*",
    "Host": "httpbin.org",
    "User-Agent": "curl/8.21.0"
  },
  "method": "GET",
  "origin": "x.x.x.x",
  "url": "https://httpbin.org/anything/hello"
}

Masked, and with httpbin's empty fields left out, the two answers look identical, and that is the point: the request was the same, with the same three headers. What changed is origin, the address the site saw. In the first answer it was our office line. In the second it was the proxy's exit, which an IP lookup placed on T-Mobile USA (AS21928) in Las Vegas, Nevada. Nothing in the request named the PC behind that address.

What the client does differently shows with curl -v. Instead of connecting to httpbin.org, curl connected to the proxy and asked it to open the connection:

* Establishing HTTP proxy tunnel to httpbin.org:443
> CONNECT httpbin.org:443 HTTP/1.1
> Host: httpbin.org:443
> Proxy-Authorization: Basic [hidden]
> User-Agent: curl/8.21.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
* CONNECT tunnel established, response 200
> GET /anything/hello HTTP/1.1
> Host: httpbin.org

Three things mark a forward proxy here. The client knows the proxy's address and port. The client logs in to it (Proxy-Authorization). And the client tells it where to go (CONNECT httpbin.org:443); the proxy will fetch any site it is asked for. What the proxy can and cannot read inside that tunnel is the subject of HTTP vs HTTPS through a proxy; the options of each client are in how to use a proxy with curl.

A reverse proxy, run for real

A reverse proxy is configured on the server side. To see one work without installing anything, this Node.js script starts two origin servers, A and B, and a reverse proxy in front of them on port 9100:

import http from 'node:http';

// two origin servers that print what reaches them
for (const [name, port] of [['A', 9101], ['B', 9102]]) {
  http.createServer((req, res) => {
    console.log(name, 'peer', req.socket.remoteAddress, JSON.stringify(req.headers));
    res.end('hello from origin ' + name + '\n');
  }).listen(port, '127.0.0.1');
}

// the reverse proxy: the only address the client knows
const backends = [9101, 9102];
let n = 0;
http.createServer((req, res) => {
  const port = backends[n++ % backends.length];          // round robin
  const headers = { ...req.headers,
    'x-forwarded-for': req.socket.remoteAddress,         // the client it saw
    'x-forwarded-proto': 'http',
    via: '1.1 demo-reverse-proxy' };
  const up = http.request({ host: '127.0.0.1', port, localAddress: '127.0.0.2',
    method: req.method, path: req.url, headers }, (r) => {
    res.writeHead(r.statusCode, { ...r.headers, via: '1.1 demo-reverse-proxy' });
    r.pipe(res);
  });
  req.pipe(up);
}).listen(9100, '127.0.0.1');

The client needs no proxy option at all. It asks for the public address, port 9100, as if that were the site. We sent six requests from the loopback address 127.0.0.3 so that the client, the proxy (127.0.0.2 on its way out) and the origins are easy to tell apart:

curl -i --interface 127.0.0.3 http://127.0.0.1:9100/hello
HTTP/1.1 200 OK
date: Fri, 20 Nov 2026 18:18:18 GMT
connection: keep-alive
keep-alive: timeout=5
content-length: 20
via: 1.1 demo-reverse-proxy

hello from origin A

And this is what the first origin server printed for that request:

A peer 127.0.0.2 {"host":"127.0.0.1:9100","user-agent":"curl/8.21.0","accept":"*/*",
  "x-forwarded-for":"127.0.0.3","x-forwarded-proto":"http",
  "via":"1.1 demo-reverse-proxy","connection":"keep-alive"}

The origin's network peer is 127.0.0.2, the reverse proxy, not the client. The origin knows the client's address only because the proxy wrote it into X-Forwarded-For. That header is a convention, not part of the connection: the reverse proxy adds it so that logs and applications behind it still know who is asking. A forward proxy that wants to keep the client private does the opposite and leaves it out, as the echo above shows: httpbin.org received three headers and no X-Forwarded-For. How much a proxy reveals in headers is what proxy anonymity levels describe; the headers themselves are covered in HTTP headers explained.

What each side saw in our run

QuestionForward proxy (mobile line)Reverse proxy (Node.js script)
Address the client connected tomobile.quanticdata.io:8080, set with -x127.0.0.1:9100, the "site" itself
Did the client name the destination to the proxy?Yes: CONNECT httpbin.org:443No: the proxy chose origin A or B
Address the origin server sawThe proxy's exit, on T-Mobile USA127.0.0.2, the proxy
Client address passed on in a headerNo X-Forwarded-For in the echox-forwarded-for: 127.0.0.3
Sign of the proxy in the responseNone in the site's answervia: 1.1 demo-reverse-proxy

Forward proxy vs reverse proxy vs load balancer

A load balancer is a reverse proxy doing one particular job: spreading requests across several servers. Our script does it in one line, backends[n++ % backends.length], which is round robin. The six requests came back like this:

hello from origin A
hello from origin B
hello from origin A
hello from origin B
hello from origin A
hello from origin B

Three went to A and three to B, and the client could not tell from the URL that two servers exist. Real reverse proxies such as nginx, Apache httpd or HAProxy add health checks, weights, TLS termination and caching on top of the same idea. A forward proxy does not balance load across a site's servers; it has no say over them. The nearest thing on the forward side is a gateway that sends your requests out through a pool of exit addresses, which is how rotating proxy plans work.

Examples and use cases

The same software can play either part. Apache's mod_proxy documentation defines both modes side by side, and nginx, mostly known as a reverse proxy, forwards requests with one proxy_pass line. What decides the name is where it stands and who configured it.

You want toKind of proxyWho runs it
Check how your site, ads or prices look to a visitor in another countryForwardYou, as the client
Collect public web data as it is served in the country you needForwardYou, as the client
Give a company network a single, logged exit to the internetForwardThe company's IT team
Put several application servers behind one hostnameReverseThe site owner
Terminate HTTPS in one place and cache static filesReverseThe site owner, or a CDN on their behalf
Keep origin servers off the public internetReverseThe site owner

Both often appear in the same request: a forward proxy chosen by the client on the way out, and the reverse proxy or CDN the site owner placed in front of the servers on the way in. Proxies can also be stacked on the client side, which is proxy chaining.

Where residential and mobile proxies fit

Residential, mobile, ISP and datacenter proxies are all forward proxies. The names say where the exit address comes from, not which way the proxy faces: a home connection, a mobile carrier, or a hosting network. You configure them on the client with a host, a port, a username and a password, exactly as in the curl command above; how to find a proxy server address shows where each of those values is, and how to check a proxy IP confirms which address a site sees.

In the test for this post the exit was a T-Mobile USA address in Nevada, chosen by adding the country to the proxy username. Our pages on mobile proxies and residential proxies list the countries and plans, what a residential proxy is explains where home IPs come from, and there is a Residential Basic free trial if you want to run the same two commands yourself.

Sources & further reading

FAQ

Quick answers on forward proxy vs reverse proxy.

Something else? Ask us

What is the difference between a forward proxy and a reverse proxy?

A forward proxy works for the client: the user configures it, and the website sees the proxy's IP address instead of the user's. A reverse proxy works for the server: the site owner puts it in front of the web servers, and visitors connect to it as if it were the site. In our test the forward proxy changed the address httpbin.org saw; the reverse proxy shared 6 requests between 2 origin servers.

Is a residential proxy a forward proxy or a reverse proxy?

A forward proxy. Residential, mobile, ISP and datacenter proxies are all set on the client, with a host, port, username and password, and make requests on the client's behalf. The name describes the network the exit IP belongs to.

Is a load balancer a reverse proxy?

A load balancer is a reverse proxy whose job is to spread requests over several servers. Our 26-line Node.js reverse proxy did it with round robin: of six requests, three were answered by origin A and three by origin B, behind a single address.

Does the website know I am using a forward proxy?

The site sees the proxy's exit address and whatever headers arrive. In our run through a mobile proxy line, httpbin.org received the same three headers curl sends directly and no X-Forwarded-For; the address belonged to T-Mobile USA.

Can nginx be a forward proxy and a reverse proxy?

nginx is built and documented as a reverse proxy: proxy_pass sends incoming requests to servers you choose. Apache httpd documents both modes in mod_proxy, with ProxyRequests for forward and ProxyPass for reverse. The software is similar; the position and the owner differ.

What does X-Forwarded-For do?

It carries the client's address through a proxy. A reverse proxy adds it so the servers behind it know who asked: our origin server saw the proxy (127.0.0.2) as its network peer and learned the client (127.0.0.3) only from x-forwarded-for.

Forward proxies on home and carrier IPs

Residential and mobile proxy lines in the country you choose, set up with one host, port, username and password.

Collectors for this data

Related reading