Nginx as a reverse proxy, forwarding to a squid proxy server

Greetings all,

Was wondering if it is possible to configure nginx as a reverse proxy
that forwards to a squid proxy server.

Currently I am using Squid as a forward proxy to another internal Squid
proxy server:
cache_peer internal_squid_proxy parent 8000 0 no-query
cache_peer_access internal_system allow internal_squid_proxy https

I’ve looked at the reverse proxy SSL write up here:
http://www.cyberciti.biz/faq/howto-linux-unix-setup-nginx-ssl-proxy/

That looks pretty close to what I want to do, except instead of
reversing directly to a web server, I need to reverse to a forward
proxy.

Ie, something like:
location / {
proxy_pass http://internal_squid_proxy;
}

Is there a cache_peer equivalent (instead of proxy_pass) for nginx?

Thank you,

Robert

Posted at Nginx Forum:

On Jan 10, 2011, at 11:21 PM, Vivek Gite wrote:
You can connect directly to your proxy server and proxy will connect
to Apache backend.

=-=-=-=-=-=

Perhaps I’m asking the question in the wrong way.

I got nginx to send connections to the internal squid server, but it’s
treating it like a normal web server instead of an HTTP proxy. How can I
get nginx to use the proxy as a proxy, instead of a web server?

So when I visit the nginx server, I just get:
ERROR

The requested URL could not be retrieved

While trying to retrieve the URL: /

The following error was encountered:

Invalid URL
Some aspect of the requested URL is incorrect. Possible problems:

Missing or incorrect access protocol (should be `http://‘’ or similar)
Missing hostname
Illegal double-escape in the URL-Path
Illegal character in hostname; underscores are not allowed
Your cache administrator is webmaster.

Generated Mon, 10 Jan 2011 21:31:07 GMT by internal_squid_server
(squid/3.0.STABLE12)

Posted at Nginx Forum: