[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-misc
Subject:    Stupid has a stupid fetch- problem
From:       Harri.Paivaniemi () tieto ! com (Harri ! Paivaniemi at tieto ! com)
Date:       2011-10-10 10:10:02
Message-ID: F5A4C3A7AC59A74FB0A0D35F1E8BDB462C9056C213 () EXMB03 ! eu ! tieto ! com
[Download RAW message or body]

Hi,

I'm just so stupid with this.

Can somebody see, why on the earth with this vcl_fetch EVERY request goes righ into \
the last configured apache_farm?

If I test this with correct url's, I can't get any traffic to match to this:

"^/easearch/json/something/") {

or this:

} elseif (req.url ~ "^/easearch") {

... and all goes, no matter what I ask, to this:

} elseif (req.url ~ "^/bar/.*\.(gif|jpg|jpeg|png|bmp|htm|html|xml|css|js|swf|flv)$") \
{

... and to apache_farm, like it was te default or something.

How come?

Thanks.

--------------------------------


sub vcl_fetch {

#1. www.foo.fi and foo.fi vhosts

if ((req.http.Host ~ "www\.foo.fi") || req.http.Host ~ "foo\.fi") {

#Set default site header
set req.http.Host = "foo.fi";

#easearch rules

#check error status first

if (beresp.status > 399) {
#no cache if status is 400 or bigger
set beresp.ttl = 0s;
return (hit_for_pass);
}

if (req.url ~ "^/easearch/json/something/") {
set beresp.ttl = 60m;
remove beresp.http.Server;
set req.backend = tom_jerry_8080;
unset beresp.http.set-cookie;
set beresp.grace = 300s;
return (deliver);

} elseif (req.url ~ "^/easearch") {
set beresp.ttl = 10m;
remove beresp.http.Server;
set req.backend = tom_jerry_8080;
unset beresp.http.set-cookie;
set beresp.grace = 300s;
return (deliver);

} elseif (req.url ~ "^/bar/.*\.(gif|jpg|jpeg|png|bmp|htm|html|xml|css|js|swf|flv)$") \
{ set req.backend = apache_farm_80;
unset beresp.http.set-cookie;
set beresp.ttl = 3m;
set beresp.grace = 300s;
return (deliver);
 
} else {
#no rules anymore for foo.fi vhost
error 200 "No rules configured for vhost foo.fi...";
}

} else {
#this was the last vhost congifured in this instance...
error 200 "Not permitted";

}
}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic