>Would someone here help me with using VCL for a complex situation with
>Varnish?
>
>sub vcl_fetch {
> if (beresp.status == 302) {
> if (beresp.http.location ~ "(.*s01.*)" ) {
> set req.backend = b1;
> set req.url = beresp.http.location;
> set req.http.host = "s01.a.com";
> }
> else if (beresp.http.location ~ "(.*s02.*)" ) {
> set req.backend = b2;
> set req.url = beresp.http.location;
> set req.http.host = "s02.com";
> }
> }
>
> restart;
>}
>
I think your "restart" is in too broad a scope (vcl_fetch is
restarting on each request?)
sub vcl_fetch {
if (beresp.status == 302) {
if (beresp.http.location ~ "(.*s01.*)" ) {
set req.backend = b1;
set req.url = beresp.http.location;
set req.http.host = "s01.a.com";
}
else if (beresp.http.location ~ "(.*s02.*)" ) {
set req.backend = b2;
set req.url = beresp.http.location;
set req.http.host = "s02.com";
}
restart;
}
}
-T.
_______________________________________________
varnish-dev mailing list
[email protected]
http://lists.varnish-cache.org/mailman/listinfo/varnish-dev