Reverse proxy to forward proxy to internet access

Francis Daly francis at
Sat May 27 08:13:18 UTC 2023

On Sat, May 27, 2023 at 09:51:10AM +0530, Miten Mehta wrote:

Hi there,

> I consider from your reply that niginx reverse proxy cannot provide
> internet access through a forward proxy like squid, websense or alike.

"http through a proxy" uses a different form of requests from "http".

nginx as a client does not make the "http through a proxy" request when
it is talking to a configured upstream server.

The general "forward proxy" server will expect clients that talk to it,
to make "http through a proxy" requests.

Your specific "forward proxy" server might be configured to
"transparently" intercept "http" requests and make a best-guess effort at
interpreting them as if they had been "http through a proxy" requests. And
that might work in many cases.

If that works well enough in your specific case, great!

Only you can know whether it works well enough in your case, to be worth
investigating further for problems.

> I understand you mentioned that nginx cannot be used as forward proxy.

nginx as a server does not specially interpret any "http through a proxy"
requests that it receives, and it does not try to follow the "http proxy
server" rules for handling requests and responses.

If what it does do, works well enough for you, great!

> There are many blogs on net claiming to use nginx as forward proxy and also
> using upstream forward proxy that is false? I don't see this in official
> documentation of nginx.

Maybe those many blogs refer to cases where the combination of their
client, their upstream proxy server, and their configuration of nginx,
works well enough for them.

In which case -- great!

You should be able to build a test nginx configuration based on those
blogs, to see whether it works well enough for you, too.

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list