Problem Upgrade to Varnish 4.1 - Multiple Backends Not Working

Drew, AJ Drew.AJ at
Fri Sep 23 13:52:14 CEST 2016


We are trying to upgrade to Varnish 4.1 from Varnish 3.0.5.

Most things are working fine, but a big problem we are running into is that we have multiple backends.  We switch backends based on URLs.  This was working fine in Varnish 3, but when we switched over to Varnish 4, it stopped working.

I have tried many variations of the URLs, and even simplified the directors so that they only contain one backend (in my tests) so that I could switch from trying the backend directly to trying the director.

Using either of the options does not seem to matter.

Has anyone else run into this problem?

Here are the sections of my VCL that contain the backends / director definitions and the if statements to switch.  I have also left in the different options (lines) I have used to come up with different combinations for testing.

probe B_probe {
        .request =
        "GET  /zzzzzz/status.php HTTP/1.1"
        "Connection: close";
        .timeout   = 0.3 s;
        .window    = 8;
        .threshold = 7;

backend B_backend1 {
        .host = "";
        .port = "8080";
        .probe = B_probe;

backend syscheck {
#        .host = "localhost";
        .host = "";
        .port = "8081";

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

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

sub vcl_init {
        new examplehosts = directors.round_robin();

        new examplesyscheck = directors.round_robin();

sub vcl_recv {

#       set req.backend_hint = examplehosts.backend();
        set req.backend_hint = B_backend1;

        if (req.url ~ "^/syscheck/.*$") {
#       if (req.url ~ "^/syscheck/*") {
#       if (req.url ~ "^/syscheck/") {
                set req.backend_hint = syscheck;
#               set req.backend_hint = examplesyscheck.backend();

        # Add simple health check for upstream load balancers
        if (req.url ~ "^/health-check") {
                return( synth(200, "UP"));


A J Drew

-----Message Disclaimer-----

This e-mail message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply email to Connect at and delete or destroy all copies of the original message and attachments thereto. Email sent to or from the Principal Financial Group or any of its member companies may be retained as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature for purposes of the Uniform Electronic Transactions Act (UETA) or the Electronic Signatures in Global and National Commerce Act ("E-Sign") unless a specific statement to the contrary is included in this message.

If you no longer wish to receive any further solicitation from the Principal Financial Group you may unsubscribe at any time.

If you are a Canadian resident and no longer wish to receive commercial electronic messages you may unsubscribe at any time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list