I'd like to know how to use varnish to cache website that is in different server?
I have my website that uses Magento CE, I have already installed turpentine extension and I have different dedicated server. I successfully installed varnish on dedicated server, how to configure varnish to tell that I need to cache website that's in different server, where should insert server ip, I only found varnish tutorials where it's installed in the same server.
You just specify within your
backend .. {
section the ip address + port of your 2nd server.
Just create a backend that points at your webservers ip or domainname.
Here a example with provided healtcheck.
probe healthcheck_webserver {
.url = "/";
.interval = 5s;
.timeout = 1s;
.window = 5;
.threshold = 3;
.expected_response = 200;
}
backend webserver {
.host = "xxx.xxx.xxx.xxx";
.port = "THEPORTTHATAPACHELISTENSTO";
.probe = healthcheck_webserver;
}
And ofcourse dont forget to use this backend in sub vcl_recv:
if (req.http.host ~ "yourdomain.com")
{
set req.backend = webserver;
}