Re: [squid-users] Rewrite url to remove folder path

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 11 Jan 2013 14:06:12 +1300

On 11/01/2013 12:32 a.m., tomsl wrote:
> I am testing squid as a reverse proxy in front of a website. What I am trying
> to do is to get some media files from a different server when they are
> requested from the main site, example:
>
> If I try to access proxy.mysite.com/media/images/image.jpg, the site
> actually gets the image from a different server, in this case from the
> rackspace cloudfiles cdn. I can get squid to use the cdn domain when getting
> the files however it still tries to get in from /media/images on the
> destination server which will not work. What I need to do is instead of
> making squid get the file from:
>
> somecontainer.rackcdn.com/media/images/image.jpg
>
> it actually gets:
>
> somecontainer.rackcdn.com/image.jpg
>
> How would I go about this?

By re-writing the URL with a helper script and the url__rewrite_program
directive.
http://www.squid-cache.org/Doc/config/url_rewrite_program/
http://wiki.squid-cache.org/Features/Redirectors

Amos
Received on Fri Jan 11 2013 - 01:06:19 MST

This archive was generated by hypermail 2.2.0 : Fri Jan 11 2013 - 12:00:04 MST