Re: [squid-users] Fwd: Url redirection to ip

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Thu, 17 Jul 2008 00:19:03 +0200

ons 2008-07-16 klockan 17:31 -0400 skrev jason bronson:

> So if i hit repairdata.php it goes to my uatbox
> if i hit index.htm it goes to admin
> if I hit just main url it goes to mybox
>
> What confuses me is the last line below
> if i change the last line to say :
> cache_peer_access mybox allow uat then it fails on mybox requests

> if i change it back to deny its fine? what exactly does this mean and
> do for that matter? somehow im guessing its related to denial of
> anything other then uat ? if thats right then why wouldnt i state
> deny uat, foo so it would denial of both?

> acl foo urlpath_regex ^/index.htm
> acl uat urlpath_regex ^/repairdata.php
>
> cache_peer_aocess uatbox allow uat
> cache_peer_access admin allow foo
> cache_peer_access mybox deny uat

This isn't complete.

The default for all is "allow" which means any of the peers may be user.

By adding an allow rule you say that this peer may only be used for the
allowed requests.

By adding a deny rule you say that this peer may only be used if the
request is not in the denied set.

Which means that mybox is valid for anything except for uat, that is
including the foo stuff which I assume you do not want to have sent that
way..

If you combine both allow & deny on the same peer then the lines is read
top down until a match is found. If no match is found for the peer the
desision is the opposite of the last rule you have for that peer.

I think the following is what you want:

cache_peer_aocess uatbox allow uat
cache_peer_access admin allow foo
cache_peer_access mybox deny uat
cache_peer_access mybox deny foo

This sends uat to uatbox, foo to admin, and anything else (not uat and
not foo) to mybox.

Regards
Henrik
Received on Wed Jul 16 2008 - 22:18:09 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 17 2008 - 12:00:03 MDT