<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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>I can't provide much detail because I don't get any reports or data from varnishlog. No errors are reported. When I run "varnishadm backend.list", the backend is reported as healthy. Plus, there's no issues with varnish communicating with the backend when
 I visit the backend host from within the varnish virtual machine. Everything works as intended when I run a web client (curl or lynx) from the varnish vm terminal. The problem is varnish doesn't communicate with the backend when I visit the backend host from
 outside the vm on my host computer's web browser.</p>
<p><br>
</p>
<p>The setup is is this - two virtual machines running in vagrant and virtualbox</p>
<p><br>
</p>
<p>192.168.33.26 (apache box with hostname clas-test.myhost.pvt listening on port 84)</p>
<p>192.168.33.27 (clas-varnish.myhost.pvt)</p>
<p><br>
</p>
<p>From default.vcl:</p>
<p><br>
</p>
<p></p>
<div>vcl 4.0;</div>
<div>import std;</div>
<div>import directors;</div>
<div><br>
</div>
<div>
<div>include "backends.vcl";</div>
</div>
<div><br>
</div>
<p></p>
<p><span>sub vcl_init {</span><br>
</p>
<p></p>
<div>    new local_test = directors.round_robin();</div>
<div>    local_test.add_backend(express_test);</div>
<div>}</div>
<span>sub vcl_recv {</span><br>
<p></p>
<p></p>
<div>  if (server.hostname == "clas-test.hostname.pvt") {</div>
<div>    set req.backend_hint = local_test.backend();</div>
<div>  }</div>
<div>}</div>
<div>
<div>sub vcl_deliver {</div>
<div>  if (obj.hits > 0) {</div>
<div>    set resp.http.X-Cache = "HIT";</div>
<div>    std.log("hitmiss:HIT");</div>
<div>  } else {</div>
<div>    set resp.http.X-Cache = "MISS";</div>
<div>    std.log("hitmiss:MISS");</div>
<div>  }</div>
}</div>
<div><br>
</div>
<p></p>
<p>From backends.vcl:</p>
<p><br>
</p>
<p></p>
<div>backend express_test {</div>
<div>  .host = "192.168.33.26"; #ip of my host in its own virtual machine</div>
<div>  .port = "84"; #port I have set in the virtual host on my host's virtual machine</div>
<div>}</div>
<div><br>
</div>
<div>In /etc/varnish/varnish.params I have the VARNISH_LISTEN_PORT set to port 80 and VARNISH_LISTEN_ADDRESS commented out. Note, that when I set the address to my backend ip, varnish won't start and I get this error:</div>
<div><br>
</div>
<div>
<div>bind(): Cannot assign requested address</div>
<div>[19743]: Error: Failed to open (any) accept sockets.</div>
<div><br>
</div>
<div>And yet when I run "varnishadm backend.list" with the listen address commented out, the backend is reported as healthy.</div>
<div><br>
</div>
<div>Thanks again, all</div>
<br>
</div>
<br>
<p></p>
<p><br>
</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> varnish-misc-bounces+tim.stalker=ucdenver.edu@varnish-cache.org <varnish-misc-bounces+tim.stalker=ucdenver.edu@varnish-cache.org> on behalf
 of Andreas Plesner <apj@mutt.dk><br>
<b>Sent:</b> Friday, January 20, 2017 2:59:10 AM<br>
<b>To:</b> 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">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>
</div>
</span></font>
</body>
</html>