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

From: jason bronson <jasonbronson_at_gmail.com>
Date: Wed, 16 Jul 2008 09:08:59 -0400

Mike

I've tried your setup like this

im getting a
1216213753.567 20 61.133.70.7 TCP_NEGATIVE_HIT/404 1345 GET
http://10.108.50.33/main_dev.php/ - NONE/- text/html

but a wget WORKS?

 wget http://10.108.50.33/main_dev.php/
--09:10:23-- http://10.108.50.33/main_dev.php/
Connecting to 10.108.50.33:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html.3'

    [ <=>
                                   ] 22,780 --.-K/s in 0s

09:10:23 (143 MB/s) - `index.html.3' saved [22780]

HERES MY CONFIG FILE?

http_port 21080 defaultsite=10.108.50.37
http_port 80 defaultsite=10.108.50.33
cache_peer 10.108.50.33 parent 80 0 name=uat no-query no-digest originserver
cache_peer 10.108.50.32 parent 80 0 name=test no-query no-digest
originserver
acl test_server_paths url_regex 245\.32\.89\.223/login/test
acl uat_server_paths url_regex 245\.32\.89\.223/login/new
cache_peer_access test allow test_server_paths
cache_peer_access uat allow uat_server_pathscache_peer 10.108.50.37
parent 21080 0 no-query originserver name=parsons
cache_peer 10.108.50.33 parent 80 0 no-query originserver
name=ldaphierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERYacl apache rep_header Server ^Apache
broken_vary_encoding allow apache
access_log /var/log/squid/access.log squiddebug_options ALL,1
url_rewrite_program /etc/squid/redirect.pl
url_rewrite_children 5
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl CONNECT method CONNECThttp_access allow manager localhost
http_access deny managerhttp_access allow localhost
http_access allow allhttp_reply_access allow all
icp_access allow all
coredump_dir /var/spool/squid

On Tue, Jul 15, 2008 at 8:50 AM, jason bronson <jasonbronson_at_gmail.com> wrote:
> Thanks Michael
>
> heres how i did setup and i get a error
> squid -k parse
> 2008/07/15 08:51:10| ACL name 'all' not defined!
> FATAL: Bungled squid.conf line 569: cache_peer_access test deny all
> Squid Cache (Version 2.6.STABLE6): Terminated abnormally.
>
>
>
>
> cache_peer 10.108.50.33 parent 80 0 name=uat no-query no-digest originserver
> cache_peer 10.108.50.32 parent 80 0 name=test no-query no-digest
> originserver
>
> acl test_server_paths url_regex 63\.132\.59\.234/login/test
> acl uat_server_paths url_regex 63\.132\.59\.234/login/new
>
> cache_peer_access test allow test_server_paths
> cache_peer_access test deny all
>
> cache_peer_access uat allow uat_server_paths
> cache_peer_access uat deny all
>
>
>
>
>
>
> On Mon, Jul 14, 2008 at 11:47 PM, Michael Alger <squid_at_mm.quex.org> wrote:
>> On Mon, Jul 14, 2008 at 04:31:35PM -0400, jason bronson wrote:
>>> Is it possible to redirect based on a URL path in squid example
>>>
>>> I have
>>> 63.45.45.45/login/test
>>> 63.45.45.45/login/new
>>>
>>> 63.45.45.45/login/test --> 10.108.111.34
>>> 63.45.45.45/login/new --> 10.108.18.254
>>>
>>> So I want to redirect squid's call based upon its external path
>>> being seen then send to the correct machine
>>
>> You need to configure a cache_peer for each backend server you want
>> to serve from:
>>
>> cache_peer 10.108.111.34 parent 80 0 name=test no-query no-digest originserver
>> cache_peer 10.108.18.254 parent 80 0 name=new no-query no-digest originserver
>>
>> The "originserver" option tells squid not to make proxy requests to
>> it, i.e. to request /foo/bar rather than http://server/foo/bar.
>>
>> The "name" option lets you refer to the cache_peer with something
>> other than its IP address, which can make your configuration more
>> readable and is especially useful if you have multiple servers on
>> the same IP but a different port.
>>
>> You then define acls to specify what traffic to allow or disallow to
>> each of these peers, and apply them with cache_peer_access:
>>
>> acl test_server_paths url_regex 63\.45\.45\.45/login/test
>> acl new_server_paths url_regex 63\.45\.45\.45/login/new
>>
>> cache_peer_access test allow test_server_paths
>> cache_peer_access test deny all
>>
>> cache_peer_access new allow new_server_paths
>> cache_peer_access new deny all
>>
>> You can probably come up with more efficient rules, but that's the
>> general approach. The "test" and "new" in the cache_peer_access
>> lines correspond to the name= assigned to each cache_peer; if you
>> don't explicitly set a name= you just use the hostname or IP address
>> of the peer.
>>
>

-- 
Thanks
Contact Information
skype: jbronson_ny
yahoo: advancedonsite
aim: advancedonsite
msn: advancedonsite_at_hotmail.com
phone: 518-791-2697
home: 518-886-8012
JasonBronson_at_gmail.com
Web Designer and Programmer
Computer Hardware Repair and More
Received on Wed Jul 16 2008 - 13:09:04 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 16 2008 - 12:00:04 MDT