Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento 如何在不同的服务器上设置varnish?_Magento_Varnish_Varnish Vcl - Fatal编程技术网

Magento 如何在不同的服务器上设置varnish?

Magento 如何在不同的服务器上设置varnish?,magento,varnish,varnish-vcl,Magento,Varnish,Varnish Vcl,我想知道如何使用清漆缓存在不同服务器上的网站 我有我的网站,使用Magento CE,我已经安装了松节油扩展,我有不同的专用服务器。我在专用服务器上成功安装了varnish,如何配置varnish来告诉我需要缓存位于不同服务器中的网站,应该在哪里插入服务器ip,我只找到varnish教程,它安装在同一服务器中。您只需在 backend .. { 划分第二台服务器的ip地址+端口。只需创建一个指向Web服务器ip或域名的后端。 这里是一个提供了healtcheck的示例 probe health

我想知道如何使用清漆缓存在不同服务器上的网站


我有我的网站,使用Magento CE,我已经安装了松节油扩展,我有不同的专用服务器。我在专用服务器上成功安装了varnish,如何配置varnish来告诉我需要缓存位于不同服务器中的网站,应该在哪里插入服务器ip,我只找到varnish教程,它安装在同一服务器中。

您只需在

backend .. {

划分第二台服务器的ip地址+端口。

只需创建一个指向Web服务器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;
}