1

Why in Varnish 4.0 can't I see my custom header set on the response ?

sub vcl_recv {
   // disable varnish for now
   return (pass);
}

sub vcl_backend_response {
    set beresp.http.X-Backend = "my_custom_hostname";
    return (deliver);
}

It was working some times ago, (in varnish 3.x or without http2 on nginx backend, don't know which factor is it).

Do you know what's causing the fact that i can't see my X-Backend custom header in the http response ?

Thanks.

1

You should be using vcl_deliver if you want to make sure that the custom header goes into the response that clients (browsers) get:

sub vcl_deliver {
    set resp.http.X-Backend = "my_custom_hostname";
    return (deliver);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.