[squid-users] Reverse proxy multiple sites with re-writing

2006-03-17 Thread Robin Bowes
Hi,

It's been a long time since I used squid - late '90s to proxy an entire
organisation's internet access over a 33.6k modem! But I digress...

I'm working on a targetted google/yahoo ad system.

For the sake of illustration, assume that Pizza Hot is a Pizza company
with a website at pizzahot.com and that my company's website is
adcounter.net.

An ad. campaign would aim to get links for Pizza Hot at the top of
search engine results.

Instead of a link to pizzahot.com, the link would be a link to
pizzahot.adcounter.net.

The idea is that pizzahot.adcounter.net would be served by a squid
instance which would serve up content from pizzahot.com, re-writing
certain key parts (telephone numbers, some URLs, etc.).

I have a couple of questions:

1. Can squid do content rewriting?
2. Would it be possible to proxy multiple such sites on one squid host?

R.



Re: [squid-users] Reverse proxy multiple sites with re-writing

2006-03-18 Thread Merton Campbell Crockett


On 17 Mar 2006, at 16:29 , Robin Bowes wrote:


I have a couple of questions:

1. Can squid do content rewriting?


Squid does not have the capability to rewrite content.  I'm not sure  
that it can rewrite the URL in accelerator mode.  Apache can rewrite  
the URL using mod_rewrite; however, it doesn't inherently provide the  
ability to rewrite page content.  Instead of using mod_proxy to  
return the retrieved content to the requestor with the rewritten URL,  
you would want to use mod_php, mod_perl, mod_python to implement a  
routine to scan and rewrite the page content.


2. Would it be possible to proxy multiple such sites on one squid  
host?


I don't know.  I use Squid in its basic form to support client  
browsers.  I use Apache and mod_rewrite to implement a service  
similar to Squid's accelerator mode and to provide SSL encryption  
between the security perimeter and the browser.


Of course, I could be all wet as I haven't really looked at the  
changes in Squid since the late Nineties.


Merton Campbell Crockett
[EMAIL PROTECTED]





Re: [squid-users] Reverse proxy multiple sites with re-writing

2006-03-19 Thread Henrik Nordstrom
lör 2006-03-18 klockan 08:08 -0800 skrev Merton Campbell Crockett:

> Squid does not have the capability to rewrite content.  I'm not sure  
> that it can rewrite the URL in accelerator mode.

Squid-2.5 in it's base distribution can't rewrite Location response
headers, but the rproxy patch from devel.squid-cache.org adds this
functionality if needed.

Just as Apache, Squid is not capable of rewriting URLs within the
content of the returned response.

If possible it is always best to ensure there is no rewrites of URLs
taking place in the accelerator. This will considerably reduce the
administrative burden even if the proxy does support full rewrites of
even returned content. Have customers doing this with a custom proxy
similar to what you describe below, and the rulesets quickly grows quite
large and very hard to track any errors.. not to mention performance
penalties from either having to buffer the whole response before
replying or disabling the use of content-length (which kills persistent
connections).

> ability to rewrite page content.  Instead of using mod_proxy to  
> return the retrieved content to the requestor with the rewritten URL,  
> you would want to use mod_php, mod_perl, mod_python to implement a  
> routine to scan and rewrite the page content.

And Squid will happily accelerate this rewriting by simply providing the
Apache server as the origin server for Squid. So you have "Internet ->
Squid -> Apache content rewrite application -> Origin server".

Or if you can make the origin server behave and use the same URLs as the
client then just "Internet -> Squid -> Origin server", without any
redirectors/rewriters of any form.

> > 2. Would it be possible to proxy multiple such sites on one squid  
> > host?

Yes, Squid supports multiple sites in accelerator form, and the content
rewriting is outside Squid as an origin site or peer proxy in the eyes
of Squid so you can have as many of these as you please.

Regards
Henrik


signature.asc
Description: Detta är en digitalt signerad	meddelandedel