Skip to end of metadata
Go to start of metadata

Category: Template Information

 

Before getting started with proxy, read: http://varnish.projects.linpro.no/static/getting-started.html.
Then, open 

 

/etc/varnish/default.vcl

 

and begin configuring to suit your needs. To configure simple round-robin proxying of 2 webservers with the following IP/Port

 

web1 - 192.168.1.100:80
web2 - 192.168.1.466:80

 

use the following entry:

 

backend web1 {
.host = "192.168.1.100";
.probe = {
.url = "/";
.interval = 1s;
.timeout = 3s;
.window = 8;
.threshold = 3;
}
}
backend web2 {
.host = "192.168.1.466";
.probe = {
.url = "/";
.interval = 1s;
.timeout = 3s;
.window = 8;
.threshold = 3;
}
}
 
director lb round-robin {
{
.backend = web1;
}
 
{
.backend = web2;
}
}
 
sub vcl_recv {
set req.backend = lb;
}

 

 When the configuration has been completed simply restart varnish

 

# /etc/init.d/varnish restart

 

and you are done!


Tags: proxy, varnish