Asking for backend set in VCL 4

Tobias Honacker t.honacker at googlemail.com
Tue Apr 26 15:06:57 CEST 2016


Hi,

what about this code

sub vcl_recv {
  set req.backend_hint = foo;
  set req.http.CurrentBackend = foo;

  if ( some condition ) {
   set req.backend_hint = bar;
   set req.http.CurrentBackend = bar;
  }

  if ( req.http.CurrentBackend ~ "foo" ) {
   /* do sth nasty */
  }
}


Viele Grüße / Regards
Tobias

2016-04-26 14:26 GMT+02:00 Andreas Haase - evolver group <
andreas.haase at evolver.de>:

> Hello,
>
> we are just migrating one varnish from 3.x to 4.0.2 (contained in Debian
> Jessie). Our old vcl contains the following structure:
>
> [...]
>
> sub vcl_recv {
>        set req.backend = foo;
>
>        if (some condition) {
>                set req.backend = bar;
>        }
>
>        [...]
>
>        if ( req.backend = foo ) {
>                /* do something nasty */
>        }
>
>        [...]
> }
>
> Now, in VCL 4 there seems no possibility to ask for the backend actually
> set. Is there any way to use this again, or do we have to use a
> work-around like setting custom http headers and later asking for their
> content?
>
> Thank you in advance for any hint :-)
>
> --
> Regards,
>
> Andreas Haase
>
> Administration und Technik
> evolver services GmbH
>
> Fon:    +49 / (0)3 71 / 4 00 03 727
> Fax:    +49 / (0)3 71 / 4 00 03 79
>
> E-Mail          andreas.haase at evolver.de
> Web             http://www.evolver.de
> Facebook        http://www.facebook.de/evolvergroup
>
>
> Sitz der Gesellschaft:  Chemnitz
> Handelsregister:        Amtsgericht Chemnitz, HRB 22649
> Geschäftsführer:        Torsten Gramann und Mathias Möckel
>
> [zu unserer Webseite]<http://www.evolver.de>
> Unsere Top-Produkte:
> - Stellenportal<http://evolver.de/stellenmarkt/>
> - Immobilienportal<http://evolver.de/immobilienmarkt/>
> - evolverOAS<http://evolver.de/oas/>
> - evolverCAS<http://evolver.de/cms#evolvercas>
> - evolverCMS<http://www.evolver.de/cms/>
>        Unsere Top-Dienstleistungen:
> - Administration & IT<http://www.evolver.de/dienstleistungen/>
> - Service-Center<http://www.evolver.de/dienstleistungen/>
> - garantierte Ressourcen<
> http://www.evolver.de/dienstleistungen/garantierte_ressourcen/>
> - Manntage-Pakete<http://www.evolver.de/dienstleistungen/manntage_pakete/>
> - evolverCLOUD<http://www.evolver.de/dienstleistungen/evolvercloud/>
>        SEO-Optimierung inklusive:
> Zur Verbesserung Ihrer Marktchancen mit unseren Produkten investieren wir
> noch mehr in die SEO-Optimierung.
> Terminvereinbarung für Präsentationen und Workshops
> Sie haben die Wahl, wie wir Ihnen unsere Produkte und Dienstleistungen
> vorstellen dürfen.
> Vereinbaren Sie einen Termin: www.evolver.de/termin<
> http://www.evolver.de/termin>.
>
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160426/36addb10/attachment.html>


More information about the varnish-misc mailing list