Re: [squid-users] Squid - Reverse Proxy

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 13 Jul 2011 17:33:27 +1200

On 13/07/11 15:52, viswanathan sekar wrote:
> Hello All,
>
> I want to configure squid like following setup and please share your
> views to achieve it.
>
> Setup:
>
> Squid is configured as a reverse proxy with two Apache servers as
> parent. In both apache servers video content will be added
> continuously.
>
> Requirement:
>
> If the requested object is not found in the first parent(Apache1.com),
> squid must check for requested object in the second
> parent(Apache2.com).
>
> Squid.conf:
>
> cache_peer parent Apache1.com parent 80 o originserver
> cache_peer parent Apache2.com parent 80 o originserver
>

Tricky. 404 (not found / does not exist) is a proper response supposed
to be sent to the client. It indicates that the object does not exist
_at all_.

You could work around that by making apache1 produce a 5xx code instead
of 404. That way Squid is tricked into believing the peer is broken and
move on to the next.

Its best to split that data between the peers based on some part of the
URL. Either the subdomain name, or the top level folder of the path.
That way Squid can check for that detail and pass requests straight to
the right origin.
  If they are supposed to be redundant mirrors of each other then place
them in the order you update the content. The one most likely to have
content will be checked first, and failure to find it there is a
guarantee that the other wont have it either.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.14
   Beta testers wanted for 3.2.0.9
Received on Wed Jul 13 2011 - 05:33:32 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 14 2011 - 12:00:02 MDT