Question about designed solution with dynamic backend setup based on csv-file with backend Basic Authentication

Aleksandar Lazic al-varnishmisc at
Thu Feb 6 16:30:08 CET 2014

Dear list members.

I have the following need.

A external script make a request  to varnish and varnish, get a picture 
from the
specified backend in the mapping file.

Store the for ~5Min (=ttl=5m) and the re-fetch it from the backend.

1.) There is a mapping file which looks like this.


2.) Build per ID a backend with username:password
3.) Use the right backend for the $REQUEST
4.) Check the backend for availability.

Due to the fact that I'm quite new to varnish I hope you can point me to 
the right way.

After some  ixquicking and googleing I have found some useful links.

My Idea based on the picture



@2.) Write a script which create a $ID.vcl with the necessary "backend 
$ID { ...}" files.
      This script add also a 'sub vcl_recv {...}' per backend with header

      set req.http.Authorization = "BASIC [base64 encoded 

@3.) add include $sysconfdir/conf.d/*.vcl into default.vcl
@4.) I will use
      with .request option for the Auth-Header.

This solution is very specific for my set-up.

Is there a more generic varnish-way to solve my need?
Can I use some 'scripting' possibilities in varnish?
Is this possible "$sysconfdir/conf.d/*.vcl"?
What do you think about the designed solution?

Thank you for reading and help.

Best regards

More information about the varnish-misc mailing list