<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Yes, when I point the backend host to the ip of the varnish virtual machine in my host computer's /etc/hosts file, I get this response in the varnish log on the varnish vm:</p>
<p><br>
</p>
<p></p>
<div>*   << BeReq    >> 17        </div>
<div>-   Begin          bereq 16 fetch</div>
<div>-   Timestamp      Start: 1485021291.247201 0.000000 0.000000</div>
<div>-   BereqMethod    GET</div>
<div>-   BereqURL       /</div>
<div>-   BereqProtocol  HTTP/1.1</div>
<div>-   BereqHeader    Host: clas-test.myvhost.pvt</div>
<div>-   BereqHeader    Upgrade-Insecure-Requests: 1</div>
<div>-   BereqHeader    User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36</div>
<div>-   BereqHeader    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8</div>
<div>-   BereqHeader    Accept-Language: en-US,en;q=0.8</div>
<div>-   BereqHeader    X-Forwarded-For: 192.168.33.1</div>
<div>-   BereqHeader    Accept-Encoding: gzip</div>
<div>-   BereqHeader    X-Varnish: 17</div>
<div>-   VCL_call       BACKEND_FETCH</div>
<div>-   VCL_return     fetch</div>
<div>-   FetchError     no backend connection</div>
<div>-   Timestamp      Beresp: 1485021291.247212 0.000011 0.000011</div>
<div>-   Timestamp      Error: 1485021291.247215 0.000013 0.000002</div>
<div>-   BerespProtocol HTTP/1.1</div>
<div>-   BerespStatus   503</div>
<div>-   BerespReason   Service Unavailable</div>
<div>-   BerespReason   Backend fetch failed</div>
<div>-   BerespHeader   Date: Sat, 21 Jan 2017 17:54:51 GMT</div>
<div>-   BerespHeader   Server: Varnish</div>
<div>-   VCL_call       BACKEND_ERROR</div>
<div>-   BerespHeader   Content-Type: text/html; charset=utf-8</div>
<div>-   VCL_return     deliver</div>
<div>-   Storage        malloc Transient</div>
<div>-   ObjProtocol    HTTP/1.1</div>
<div>-   ObjStatus      503</div>
<div>-   ObjReason      Backend fetch failed</div>
<div>-   ObjHeader      Date: Sat, 21 Jan 2017 17:54:51 GMT</div>
<div>-   ObjHeader      Server: Varnish</div>
<div>-   ObjHeader      Content-Type: text/html; charset=utf-8</div>
<div>-   Length         27910</div>
<div>-   BereqAcct      0 0 0 0 0 0</div>
<div>-   End            </div>
<div><br>
</div>
<div><br>
</div>
<div>*   << Session  >> 163842    </div>
<div>-   Begin          sess 0 HTTP/1</div>
<div>-   SessOpen       192.168.33.1 40398 :80 192.168.33.27 80 1485021291.241650 16</div>
<div>-   SessClose      RX_TIMEOUT 5.094</div>
<div>-   End            </div>
<div><br>
</div>
<div>*   << Session  >> 131074    </div>
<div>-   Begin          sess 0 HTTP/1</div>
<div>-   SessOpen       192.168.33.1 40400 :80 192.168.33.27 80 1485021291.241657 17</div>
<div>-   SessClose      RX_TIMEOUT 5.094</div>
<div>-   End            </div>
<div><br>
</div>
<div>*   << Session  >> 15        </div>
<div>-   Begin          sess 0 HTTP/1</div>
<div>-   SessOpen       192.168.33.1 40396 :80 192.168.33.27 80 1485021291.241622 14</div>
<div>-   Link           req 16 rxreq</div>
<div>-   Link           req 18 rxreq</div>
<div>-   SessClose      RX_TIMEOUT 5.395</div>
<div>-   End          </div>
<p></p>
<p><br>
</p>
<p>Any ideas? I can only think that it's a networking issue because the same setup I have, same default.vcl, backends.vcl files, with apache installed on the same VM as varnish, works fine. The backend host when separate from varnish in its own VM also works
 fine. But varnish cannot connect to it.</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Miguel González <miguel_3_gonzalez@yahoo.es><br>
<b>Sent:</b> Friday, January 20, 2017 3:18:51 PM<br>
<b>To:</b> Stalker, Tim; Andreas Plesner; varnish-misc@varnish-cache.org<br>
<b>Subject:</b> Re: Varnish on stand-alone server</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">What about the acl purge entries?<br>
<br>
You probably know that you have to add in your hosts file where you are<br>
running your browser you have to point the domain you are hitting with<br>
the ip address of your varnish VM, don´t you?<br>
<br>
Miguel<br>
<br>
<br>
<br>
<br>
On 01/20/17 5:38 PM, Stalker, Tim wrote:<br>
> I can't provide much detail because I don't get any reports or data from<br>
> varnishlog. No errors are reported. When I run "varnishadm<br>
> backend.list", the backend is reported as healthy. Plus, there's no<br>
> issues with varnish communicating with the backend when I visit the<br>
> backend host from within the varnish virtual machine. Everything works<br>
> as intended when I run a web client (curl or lynx) from the varnish vm<br>
> terminal. The problem is varnish doesn't communicate with the backend<br>
> when I visit the backend host from outside the vm on my host computer's<br>
> web browser.<br>
> <br>
> <br>
> The setup is is this - two virtual machines running in vagrant and<br>
> virtualbox<br>
> <br>
> <br>
> 192.168.33.26 (apache box with hostname clas-test.myhost.pvt listening<br>
> on port 84)<br>
> <br>
> 192.168.33.27 (clas-varnish.myhost.pvt)<br>
> <br>
> <br>
> From default.vcl:<br>
> <br>
> <br>
> vcl 4.0;<br>
> import std;<br>
> import directors;<br>
> <br>
> include "backends.vcl";<br>
> <br>
> sub vcl_init {<br>
> <br>
>     new local_test = directors.round_robin();<br>
>     local_test.add_backend(express_test);<br>
> }<br>
> sub vcl_recv {<br>
> <br>
>   if (server.hostname == "clas-test.hostname.pvt") {<br>
>     set req.backend_hint = local_test.backend();<br>
>   }<br>
> }<br>
> sub vcl_deliver {<br>
>   if (obj.hits > 0) {<br>
>     set resp.http.X-Cache = "HIT";<br>
>     std.log("hitmiss:HIT");<br>
>   } else {<br>
>     set resp.http.X-Cache = "MISS";<br>
>     std.log("hitmiss:MISS");<br>
>   }<br>
> }<br>
> <br>
> From backends.vcl:<br>
> <br>
> <br>
> backend express_test {<br>
>   .host = "192.168.33.26"; #ip of my host in its own virtual machine<br>
>   .port = "84"; #port I have set in the virtual host on my host's<br>
> virtual machine<br>
> }<br>
> <br>
> In /etc/varnish/varnish.params I have the VARNISH_LISTEN_PORT set to<br>
> port 80 and VARNISH_LISTEN_ADDRESS commented out. Note, that when I set<br>
> the address to my backend ip, varnish won't start and I get this error:<br>
> <br>
> bind(): Cannot assign requested address<br>
> [19743]: Error: Failed to open (any) accept sockets.<br>
> <br>
> And yet when I run "varnishadm backend.list" with the listen address<br>
> commented out, the backend is reported as healthy.<br>
> <br>
> Thanks again, all<br>
> <br>
> <br>
> <br>
> ------------------------------------------------------------------------<br>
> *From:* varnish-misc-bounces+tim.stalker=ucdenver.edu@varnish-cache.org<br>
> <varnish-misc-bounces+tim.stalker=ucdenver.edu@varnish-cache.org> on<br>
> behalf of Andreas Plesner <apj@mutt.dk><br>
> *Sent:* Friday, January 20, 2017 2:59:10 AM<br>
> *To:* varnish-misc@varnish-cache.org<br>
> *Subject:* Re: Varnish on stand-alone server<br>
>  <br>
> On Thu, Jan 19, 2017 at 06:23:56PM +0000, Stalker, Tim wrote:<br>
>> Varnish is aware of the backend I have set and works fine as long as I'm<br>
>> logged into its virtual machine and run either curl or lynx to the address of<br>
>> the machine with apache running. I have my /etc/hosts file set with the<br>
>> backend address and virtual host as configured in the apache box, but it<br>
>> seems that varnish ignores the /etc/hosts file. I get logging and see the<br>
>> headers when I run curl -I<br>
>> <a href="http://backend.vhost.name<http://backend.vhost.name/">http://backend.vhost.name<http://backend.vhost.name/</a>> but when I do the same<br>
>> thing via the browser, curl, or lynx on my host computer, no logging, nothing<br>
>> happens inside the varnish vm.<br>
> <br>
> You're not giving us any info that actually enables us to help you. What<br>
> doesn't work? What error messages do you get? What did you already try? What<br>
> were the results of these attempts? What is in the log?<br>
> <br>
> Most important is:<br>
> <br>
> What doesn't work? You've only stated that it doesn't work, not what is<br>
> actually happening when you've determined that it doesn't work.<br>
> <br>
> -- <br>
> Andreas<br>
> <br>
> _______________________________________________<br>
> varnish-misc mailing list<br>
> varnish-misc@varnish-cache.org<br>
> <a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
> <br>
> <br>
> _______________________________________________<br>
> varnish-misc mailing list<br>
> varnish-misc@varnish-cache.org<br>
> <a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
> <br>
<br>
</div>
</span></font>
</body>
</html>