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

Aleksandar Lazic al-varnishmisc at none.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.

id;URL;username;password

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.

https://ixquick.com/do/search?q=varnish+backend+auth
https://www.google.de/#q=site:varnish-cache.org+auth

https://stackoverflow.com/questions/17704712/varnish-and-esi-http-auth

My Idea based on the picture

https://www.varnish-cache.org/trac/wiki/VCLExampleDefault

and

https://www.varnish-cache.org/docs/3.0/reference/vcl.html?highlight=include#multiple-subroutines

is.

@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 
admin:adminpass]"

@3.) add include $sysconfdir/conf.d/*.vcl into default.vcl
@4.) I will use 
https://www.varnish-cache.org/docs/3.0/reference/vcl.html?highlight=include#backend-probes
      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
Aleks



More information about the varnish-misc mailing list