<div dir="ltr">Can you provide a varnishlog of the request where you get the backend errors?</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--<br>Reza Naghibi<br>Varnish Software</div></div></div>
<br><div class="gmail_quote">On Sat, May 6, 2017 at 3:45 PM, Nigel Peck <span dir="ltr"><<a href="mailto:np.lists@sharphosting.uk" target="_blank">np.lists@sharphosting.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
You might try Stack Overflow if you're not having any luck on this list. There are a few folks who answer Varnish questions on there. Just tag it "varnish" and "varnish-vcl".<br>
<br>
Nigel<span class=""><br>
<br>
On 06/05/2017 14:40, Kurt Sultana wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Ideas anyone? Any help is appreciated.<br>
<br>
Thanks<br>
<br></span><span class="">
On 4 May 2017 2:33 p.m., "Kurt Sultana" <<a href="mailto:kurtanatlus@gmail.com" target="_blank">kurtanatlus@gmail.com</a> <mailto:<a href="mailto:kurtanatlus@gmail.com" target="_blank">kurtanatlus@gmail.com</a>><wbr>> wrote:<br>
<br>
Hi all,<br>
<br>
I'm a bit newish to Varnish though I do have some background. I have<br>
a Varnish 5 instance connected to 2 backend servers (Magento 2<br>
applications).<br>
<br>
I'm using the new Varnish 5 feature of loading multiple VCL files.<br>
My ultimate problem is during purging however I'd like to ensure<br>
things are set up correctly because documentation regarding multiple<br>
VCL files in Varnish 5 is somewhat lacking.<br>
<br>
To keep things very simple for now, I'm going to use 1 backend<br>
server in my example.<br>
<br>
So, I have a magento.vcl defined as follows:<br>
<br></span>
*vcl 4.0;*<br>
<br>
*import std;*<br>
*<br>
*<br>
*# The minimal Varnish version is 4.0*<br>
*# For SSL offloading, pass the following header in your proxy<br>
server or load balancer: 'X-Forwarded-Proto: https'*<br>
*<br>
*<br>
*backend default {*<br>
* .host = "127.0.0.1";*<br>
* .port = "8088";*<br>
*}*<br>
*<br>
*<br>
*include "/etc/varnish/common.vcl";*<br>
<br>
And a top.vcl<br>
<br>
*vcl 4.0;*<br>
*<br>
*<br>
*import std;*<br>
*<br>
*<br>
*backend default { .host = "127.0.0.1"; }*<br>
*<br>
*<br>
*sub vcl_recv {*<br>
* if (req.http.host == "magento2.dev") {*<br>
* return (vcl(magento_vcl));*<br>
* }*<br>
*}*<br>
<br>
Then I run<br>
<br>
*service varnish restart*<br>
<br>
*varnishadm*<br>
<br>
*vcl.load magento /etc/varnish/conf.d/<a href="http://magento.vc" rel="noreferrer" target="_blank">magento.vc</a> <<a href="http://magento.vc" rel="noreferrer" target="_blank">http://magento.vc</a>>l*<br>
<br>
*vcl.label magento_vcl magento*<br>
<br>
*vcl.load top /etc/varnish/top.vcl*<br>
<br>
*vcl.use top*<br>
<br>
*quit*<span class=""><br>
<br>
<br>
When I browse to magento2.dev, I get a backend fetch error after<br>
some seconds. It's only when I go in magento.vcl and change the name<br>
of the backend and make a backend hint that it works. See below:<br>
<br></span>
*vcl 4.0;*<br>
<br>
*import std;*<br>
*<br>
*<br>
*# The minimal Varnish version is 4.0*<br>
*# For SSL offloading, pass the following header in your proxy<br>
server or load balancer: 'X-Forwarded-Proto: https'*<br>
*<br>
*<br>
*backend magento {*<br>
* .host = "127.0.0.1";*<br>
* .port = "8088";*<br>
*}*<br>
*<br>
*<br>
*<span class=""><br>
sub vcl_recv {<br>
set req.backend_hint = magento;<br>
}<br></span>
*<br>
*<br>
*<br>
*include "/etc/varnish/common.vcl";*<br>
*<br>
*<span class=""><br>
Why should I be specifying a backend hint? Shouldn't Varnish be<br>
loading a different VCL according to the host specified in top.vcl?<br>
Or is there something wrong?<br>
<br>
Thanks in advance,<br>
Kurt<br>
<br>
<br>
<br>
<br></span>
______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/varnish<wbr>-misc</a><br>
<br>
</blockquote>
<br>
______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/varnish<wbr>-misc</a><br>
</blockquote></div><br></div>