[squid-users] Routing requests issues in hierarchy setup

From: Lucas Brasilino <lucas.brasilino_at_gmail.com>
Date: Wed, 3 Dec 2008 20:09:44 -0200

Hi Folks:

I'm getting puzzled with routing requests with Squid 2.7STABLE5 and how
'always_direct' and 'never_direct' works. Basically I'd
like to route a requests with a specific extension to another squid
instance, requests to my domain to go directly and outside
requests go through my parent proxys.
 Following the informations in
http://wiki.squid-cache.org/KnowledgeBase/HierarchyControl
and in the comments of squid.conf.default I've made:

# parent cache's (border caches)
cache_peer proxy1.bar.com parent 3128 0 no-query no-delay round-robin
no-digest name=proxy1
cache_peer proxy2.bar.com parent 3128 0 no-query no-delay round-robin
no-digest name=proxy2
cache_peer proxy3.bar.com parent 3128 0 no-query no-delay round-robin
no-digest name=proxy3
cache_peer proxy4.bar.com parent 3128 0 no-query no-delay round-robin
no-digest name=proxy4

# other squid instance
cache_peer localhost parent 3129 0 no-query no-digest name=tier2

acl bar dstdomain .bar.com
acl foo dstdomain foo.bar.com
acl caching_tier2 url_regex -i (\.css|\.jar|\.png|\.gif|\.jpg|\.js)$

# removing Pragma header and sending specific requests to foo
header_access pragma deny caching_tier2
cache_peer_access tier2 allow caching_tier2 foo
cache_peer_access tier2 deny all

cache_peer_access proxy1 deny caching_tier2 foo
cache_peer_access proxy2 deny caching_tier2 foo
cache_peer_access proxy3 deny caching_tier2 foo
cache_peer_access proxy4 deny caching_tier2 foo

always_direct allow !caching_tier2 bar
never_direct allow all

Since 'allow' match of 'always_direct' goes directs, any request to
domain 'bar.com' which doesn't matches
'caching_tier2' ACL should go direct. But what is happening is:

request to http://foo.bar.com/something.jpg => routed to tier2 => OK
request to http://other.bar.com/<anything> => routed to parents => NOT OK!
request to http://outside.world.com/<anything> => routed to parents => OK!

So...Where am I messing things up ?? :-)

Thanks in advance
Lucas Brasilino
Received on Wed Dec 03 2008 - 22:09:55 MST

This archive was generated by hypermail 2.2.0 : Sun Dec 07 2008 - 12:00:02 MST