Search squid archive

Re: Squid Reverse Proxy Superset / Subset server scenario

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/14/2013 09:15 PM, zipped wrote:

> I need to setup a reverse proxy as follows.  I have a master web server that
> has the superset of my website/database, server A.  I also have another
> website that would have a subset of my website/database, server B.  I need a
> proxy server that can send all requests to the subset server, B.  Then based
> on the response from that request either return the response to the client
> or forward the request higher to server A.  This would be analogous to
> having a world wide corporate website and a regional website where most of
> the data requested from a specific area is on the regional website but there
> are a few occasions when the world wide corporate site must be queried.  
> 
> So in this scenario the request goes to proxy, then to server B,  something
> is written to the request response indicating the request was not
> successfully found on server B.   Then the request is forwarded up higher to
> server A and sent back to the client.  
> 
> The other possible scenario would be the request goes to the proxy, then to
> server B, the request is found and returned to the client with no further
> need for server A.
> 
> Is this possible with squid without modifying the source?


I think it is possible, provided the negative response from server B
matches Squid response re-forwarding criteria documented at

http://wiki.squid-cache.org/SquidFaq/InnerWorkings?#When_does_Squid_re-forward_a_client_request.3F

The last few bullets in that long list are especially important in your
case. Please keep in mind that the list items document cases when Squid
will _not_ re-forward a request. You may want to convert the last two
bullets into positive cases to decide which response status codes you
should test with.


In addition to an appropriate response from server B, you will need to
configure server B and server A to be cache_peers of your reverse proxy
and make sure server B is used as the first choice. See cache_peer in
squid.conf.documented or at
http://www.squid-cache.org/Doc/config/cache_peer/


HTH,

Alex.





[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux