Search squid archive

Re: Poor mans static CDN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Robertson wrote:
beachie@xxxxxxxxxxxxx wrote:
----Original Message----
From: crobertson@xxxxxxx
Date: 26/01/2010 0:24 To: <squid-users@xxxxxxxxxxxxxxx>
Subj: Re:  Poor mans static CDN

<snip>

A simple redirect program that strips a leading "cache." from the requested domain name will give you the flexibility to do this.

Thanks for responding Chris.

So now I have the following config:

http_port external-iip2:80 vhost defaultsite=blog.tld
cache_peer blog.tld parent 80 0 no-query originserver login=PASS url_rewrite_program /etc/squid/r.pl

r.pl does a simple substitution s/cache.blog.tld/blog.tld/i and appears to be working

clientRedirectDone: 'http://cache.blog.tld/?9834733' result=http:
//blog.tld/?9834733  << [check]

But the debug shows the request being build with the cache hostname.

httpBuildRequestHeader: Host: cache.blog.tld
httpBuildRequestHeader: User-Agent: ...
...
Packet capture:
GET /?9834733 HTTP/1.0
Host: cache.blog.tld

Any more ideas?

http://www.squid-cache.org/Doc/config/url_rewrite_host_header/

Should be "on" by default, so I didn't mention it originally.

I believe the whole rewriter part is the same as setting the forcedomain=blog.tld option on the cache_peer line.

If that works it will be a lot more efficient than a redirector ever can.

Amos
--
Please be using
  Current Stable Squid 2.7.STABLE7 or 3.0.STABLE21
  Current Beta Squid 3.1.0.15

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux