Unexpected response from varnish (3)

dE de.techno at gmail.com
Sat Oct 17 12:46:28 CEST 2015


I created this 'odd' varnish configuration for educational purposes --

backend default {
         .host = "neuro.debian.net";
         .port = "http";
}

sub vcl_recv {
         set req.backend = default;
         set req.http.host = "neuro.debian.net";
         return(lookup);
}

sub vcl_miss {
         set bereq.http.host = "example.com";
}

sub vcl_hit {
         error 200 "returned from cache";
}

sub vcl_fetch {
         set beresp.status = 500;
         return (hit_for_pass);
}

Ideally it must only fetch from the backend and it must return Apache's 
'It works!' every time since neuro.debian.net is configured to respond 
properly only if the hostname is set to neuro.debian.net, otherwise 'It 
works!'.

There must never be a cache hit.

But the expected happens only once on the first request. But then 
afterward, the real website of neuro.debian.net in a crippled way, and 
sometimes there is just a blank page.

Thanks for any help!



More information about the varnish-misc mailing list