New challenge for Varnish!

zabrane Mikael zabrane3 at
Thu Jul 8 07:37:19 CEST 2010

Hi List,

Yesterday with Varnish users help (thanks again guys), I succeeded with an
extreme simplicity to solve the problem I described here:

Today, I've a new challenge for Varnish to extend the capabilties of my
customserver !!!

My current "customserver.vcl" contains 2 backends:
backend squid {
  .host = "";
  .port = "3128";

backend customserver {
  .host = "";
  .port = "80";

sub vcl_recv {
  // set default backend
  set req.backend = squid;

  if (req.http.X-RAWDATA != "") {
        set req.backend = customserver;


1. If an HTTP request arrives with a special header "X-STORE-IN-FILE: UUID",
I'd like Varnish to get the response data from "squid" backend, save the
"raw HTTP response" on disk under filename "UUID" before sending it back to
the client.

2. If (1) is doable, I'd like Varnish to save both "raw HTTP request and
response" (by "raw", I mean HTTP hearders and payload) in the file "UUID".

Any pointer, hint, or piece of VCL will be very welcome!
Thanks in advance.

NOTE: UUID is a Universally Unique Identifier used in my context to have
unique filenames on disk.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list