Mailing List Archive

Fwd: Newbie varnish configuration
Hi,

I'd like to use Varnish as nothing more than a basic Internet security
appliance, that is set it up with a whitelist of sites and direct all other
domains to a local page which will ask for authentication, then forward
along if passed. I'm trying to just get google.com and
wikipedia.orgworking as pass-through with the following VCL... and
I'm having trouble.
Eventually I'd like to implement caching, but I'd like to just get the
simple stuff going for now.

Thanks for any insight you can provide.

----
# This is a basic vcl.conf file for varnish.
# Modifying this file should be where you store your modification to
# varnish. Settnigs here will override defaults.

backend default {
set backend.host = "127.0.0.1";
set backend.port = "80";
}

backend google {
set backend.host = " www.google.com";
set backend.port = "80";
}

backend wikipedia {
set backend.host = "www.wikipedia.org ";
set backend.port = "80";
}

sub vcl_recv {
if (req.request == "POST") {
pipe;
}

if ( req.http.host ~ "^(www\.)?google\.com$") {
set req.backend = google;
pass;
}
elseif (req.http.host ~ "^(www\.)?wikipedia\.org$") {
set req.backend = wikipedia;
pass;
}
elseif (req.http.host ~ "^(en\.)?wikipedia\.org$") {
set req.backend = wikipedia;
pass;
}


# force lookup even when cookies are present
if (req.request == "GET" && req.http.cookie) {
lookup;
}
}

sub vcl_fetch {
# force minimum ttl of 180 seconds
if (obj.ttl < 180s) {
set obj.ttl = 180s;
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.linpro.no/pipermail/varnish-misc/attachments/20070625/c5b1328a/attachment.htm
Fwd: Newbie varnish configuration [ In reply to ]
In message <3fc325330706250718y7d41a0bev91ae23f946b5b7dc at mail.gmail.com>, "Andr
ew Baudouin" writes:

>I'm having trouble.

Me too. For one thing your report contains absolutely no indication of
waht kind of trouble you might be having.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
Fwd: Newbie varnish configuration [ In reply to ]
"Andrew Baudouin" <andrewmb at gmail.com> writes:
> I'd like to use Varnish as nothing more than a basic Internet security
> appliance, that is set it up with a whitelist of sites and direct all
> other domains to a local page which will ask for authentication, then
> forward along if passed. I'm trying to just get google.com and
> wikipedia.orgworking as pass-through with the following VCL... and I'm
> having trouble. Eventually I'd like to implement caching, but I'd
> like to just get the simple stuff going for now.

Varnish is not a client-side cache, and can't be used for what you're
trying to do.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no