How to configure varnish on another server?

I would like to know how to use varnish to cache a website that is on another server?

I have my site that uses Magento CE, I already have the turpentine extension installed, and I have a dedicated dedicated server. I have successfully installed the varnish on a dedicated server, how to configure the varnish to say that I need to cache the website, which on the other server, where the ip server should be inserted, I only found varnish tutorials where it was installed on the same server.

0
source share
2 answers

You just indicate in your

backend .. {

section ip address + port of your second server.

0
source

, - ip . 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;
}

, , sub vcl_recv:

if (req.http.host ~ "yourdomain.com") 
{
    set req.backend = webserver;
}
0

Source: https://habr.com/ru/post/1694954/


All Articles