[squid-users] Re: multiple web servers - squid looks for images on wrong server.

From: kadvar <kadvar_at_gmail.com>
Date: Thu, 1 Mar 2012 00:35:17 -0800 (PST)

Amos Jeffries-2 wrote
>
>
>>
>> #192.168.124.41/images has to be redirected to another web server
>> acl images urlpath_regex images
>
> Problem #1: everything with the letters "images" in the URL path gets
> matched by this.
>
> For examples:
> http://example.com/images/haha.html
> http://example.com/boo/?images
> http://example.com/scripts/images.js
> http://example.com/videos/images.avi
> http://google.com/images?q=boo
> http://192.168.124.41/images.html
>
>
> Careful with regex.
>
>>
>> #now that images has been found deny the request being sent to server
>> 1
>> cache_peer 127.0.0.1 parent 80 0 no-query originserver name=server1
>> cache_peer_access server1 deny images
>
> PROBLEM #2: "myimage.jpg" does not contain an "s". The 'images' ACL
> definition does not prevent it going to this peer.
>
>
>>
>> #now send the image requests to server 2, first create peer
>> cache_peer 192.168.124.40 parent 80 0 no-query originserver
>> name=server2
>> #now send image requests to peer
>> cache_peer_access server2 allow images
>> cache_peer_access server2 deny all
>
>
> Amos
>

Thank you for that! I still have a problem with the images thing. I re-wrote
the regex as

acl images_reg urlpath_regex ^/images/

Lets say I have a page www.mysite.com/images/mygallery.html which has an
image file tiger.jpg embedded. Now squid matches
www.mysite.com/images/mygallery.html and sends it to server 2 but still
looks for tiger.jpg on server 1 even though it's on the same server as
mygallery.html (server 2).

Thanks,
Adi

--
View this message in context: http://squid-web-proxy-cache.1019090.n4.nabble.com/multiple-web-servers-squid-looks-for-images-on-wrong-server-tp4431686p4434384.html
Sent from the Squid - Users mailing list archive at Nabble.com.
Received on Thu Mar 01 2012 - 08:35:19 MST

This archive was generated by hypermail 2.2.0 : Thu Mar 01 2012 - 12:00:06 MST