server name in config?

Richard Chiswell richard.chiswell at mangahigh.com
Mon Apr 12 18:53:25 CEST 2010


Try something like:
sub vcl_deliver {
if (obj.hits > 0) {
             set resp.http.X-MH-Cache = "HIT " obj.hits " "* 
server.hostname* " " resp.http.Age;
         } else {
             set resp.http.X-MH-Cache = "MISS " *server.hostname* " " 
resp.http.Age;
         }
}

Richard

On 12/04/2010 17:47, Angelo Höngens wrote:
> Hey,
>
> Is there a way to use fields in the VCL like the current server's name? I'd like to output some extra header in the response like 'X-Varnish-host: balancer1.domain.local' or something like that, and use the balancer hostname in the custom error message I've created.
>
> (I could of course change the config for each balancers, but I'd like to keep one single config for all balancer nodes, easier to copy around and such.)
>
> If this is not possible, please consider it a feature request ;) Thanks in advance.
>
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100412/3f63e0f3/attachment-0003.html>


More information about the varnish-misc mailing list