Loadbalancing with 301 / 302

Carsten Dietz carsten.dietz at arejo.de
Thu Jul 28 14:16:29 CEST 2011


Hi,

 

I want to setup varnish as an loadbalancer for 4-5 Downloadserver.

The best way to loadbalance with Failover is Roundrobin.

 

 

backend img4 {

  .host = "img4.test.com";

  .probe = {

                .url = "/";

                .interval = 5s;

                .timeout = 1 s;

                .window = 5;

                .threshold = 3;

  }

}

 

backend img5 {

  .host = "img5.test.com ";

  .probe = {

                .url = "/";

                .interval = 5s;

                .timeout = 1 s;

                .window = 5;

                .threshold = 3;

  }

}

 

 

backend img6 {

  .host = "img6.test.com ";

  .probe = {

                .url = "/";

                .interval = 5s;

                .timeout = 1 s;

                .window = 5;

                .threshold = 3;

  }

}

 

backend img7 {

  .host = "img7.test.com ";

  .probe = {

                .url = "/";

                .interval = 5s;

                .timeout = 1 s;

                .window = 5;

                .threshold = 3;

  }

}

 

director baz round-robin {

        {

                .backend = img4;

        }

        {

                .backend = img5;

        }

         {

                .backend = img6;

        }

         {

                .backend = img7;

        }

        

}

 

sub vcl_recv {

  set obj.http.Location = baz;

  set obj.status = 301;

  return(deliver);

}

 

I try to set other variables but it try to start with this gives an error.

 


Has anybody an idea how it can works?

 

Thanks Carsten

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110728/ce60d62d/attachment-0003.html>


More information about the varnish-misc mailing list