Warming the cache from an existing squid proxy instance

Hauke Lampe lampe at hauke-lampe.de
Sat Mar 26 18:05:03 CET 2011


On 25.03.2011 11:55, Jonathan Matthews wrote:

> The squid instances are running in proxy mode, and require (I
> *believe*) an HTTP CONNECT.

Do they really? I would think squid just pipes a CONNECT request wihout
caching the contents, just like varnish does. I'm not quite sure about
that, though.

What I *think* you need to do is to rewrite the request URL so that it
contains the hostname.

An incoming request like this.

| GET /foo
| Host: example.com

should be passed to squid in this form:

| GET http://example.com/foo

In VCL:

set req.backend = squid;
if (req.url ~ "^/" && req.http.Host) {
	set req.url = "http://" req.http.Host req.url;
	unset req.http.Host;
}


Hauke.




More information about the varnish-misc mailing list