[squid-users] Need help with Squid reverse proxy with mirrored parents please!

From: Alex Stahl <testcore_at_gmail.com>
Date: Wed, 27 Mar 2013 16:28:34 -0700

Hiya Squid Users - So I'm trying to configure Squid as a reverse
proxy, listening on port 80, in front of two web servers. One web
server runs on the localhost and listens on port 81 and contains a
subset of all website content. Then the second web server is a remote
box, listening on port 80, with a full set of all content.

What I'd like Squid to do is act as a single front-end for these
servers. A request comes in, and if it's a cache miss, it should
first ask the localhost web server if it can satisfy the request. If
so, it serves it up. If not, it should forward it on to the second
web server.

Following the guide here:
http://wiki.squid-cache.org/ConfigExamples/Reverse/MultipleWebservers,
I've come up with the following config:

http_port 80 accel defaultsite=localhost
cache_peer localhost parent 81 0 originserver name=local
cache_peer example.com parent 80 0 originserver name=remote
acl request dstdomain localhost
cache_peer_access local allow request
cache_peer_access remote allow request

(I have other ACLs unrelated to this config, such as allowing http
requests on port 80).

The problem I run into is that a miss on the localhost web server (an
HTTP 404) isn't properly forwarded on to the remote server - squid
only ever tries a single parent. If I remove the localhost peer, the
request is properly forwarded, and I get back the expected HTTP 200.

What am I missing in my config to make it do that?

Thanks,
Alex
Received on Wed Mar 27 2013 - 23:28:40 MDT

This archive was generated by hypermail 2.2.0 : Thu Mar 28 2013 - 12:00:08 MDT