<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-family:arial,sans-serif;font-size:13px">You can serve content directly using a synthetic response. Other than<br>
</span><span style="font-family:arial,sans-serif;font-size:13px">that, you'll need to run a local webserver and redirect requests for<br></span><span style="font-family:arial,sans-serif;font-size:13px">that file to the appropriate backend.</span></blockquote>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-family:arial,sans-serif;font-size:13px">Having said that, if you want proper end to end testing, you're better<br>
</span><span style="font-family:arial,sans-serif;font-size:13px">off either serving the healthcheck file from the backends with a<br></span><span style="font-family:arial,sans-serif;font-size:13px">passthrough (so you can ensure that varnish is able to get to at least<br>
</span><span style="font-family:arial,sans-serif;font-size:13px">one backend) or with a very short TTL (tests caching as well as backend<br></span><span style="font-family:arial,sans-serif;font-size:13px">availability, but has a longer recovery time if a varnish host is unable<br>
</span><span style="font-family:arial,sans-serif;font-size:13px">to reach any backends).</span> </blockquote><div><br></div><div>Thanks for your input! So the idea here is to get the varnish servers themselves check in with the F5. It's a form of health check polling that they do to determine that the varnish hosts are online. I could do a pass through to the web servers to serve the health check file. That should still let the F5's know that the varnish hosts are alive. </div>
<div><br></div><div>But for now I've just fired up a copy of apache locally on port 80. So as of now I can do a GET on that healthcheck file:</div><div><br></div><div><div>[root@varn001 varnish]# GET http://$(hostname -f)/healthcheck.php</div>
<div>good</div></div><div><br></div><div>And I tried popping the following into my sub recv_vcl in the hopes that it could return the same result on 8080:</div><div><br></div><div><div> # Let all health check requests from F5 pass through completely.</div>
<div> if (req.url ~ "^/healthcheck\.php") {</div><div> return (pipe);</div><div> }</div></div><div><br></div><div>But after I bounce varnish with the change I get this result:</div><div><br></div><div><div>
[root@varn001 varnish]# GET http://$(hostname -f):8080/healthcheck.php</div><div><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"></div><div><html><head></div><div><title>404 Not Found</title></div>
<div></head><body></div><div><h1>Not Found</h1></div><div><p>The requested URL /healthcheck.php was not found on this server.</p></div><div><hr></div><div><address>Apache Server at <a href="http://varn001.dmz.tfayd.com">varn001.dmz.tfayd.com</a> Port 8080</address></div>
<div></body></html></div></div><div><br></div><div>Any thoughts on how to solve this?</div><div><br></div><div>Thanks,</div><div>Tim</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Jul 20, 2014 at 10:35 AM, Paul Armstrong <span dir="ltr"><<a href="mailto:varnish-cache@otoh.org" target="_blank">varnish-cache@otoh.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">At 2014-07-20T10:36-0400, Tim Dunphy wrote:<br>
> Such that you can do a :<br>
> GET http://$(hostname -f):8080/healtcheck.php<br>
> And return the contents of that file (which is simply the word 'good').<br>
> I've been googling a while and not found any advice on how to server a<br>
> text file locally on the varnish server itself.<br>
> Is there any way I can do this easily in my VCL?<br>
<br>
</div>You can serve content directly using a synthetic response. Other than<br>
that, you'll need to run a local webserver and redirect requests for<br>
that file to the appropriate backend.<br>
<br>
Having said that, if you want proper end to end testing, you're better<br>
off either serving the healthcheck file from the backends with a<br>
passthrough (so you can ensure that varnish is able to get to at least<br>
one backend) or with a very short TTL (tests caching as well as backend<br>
availability, but has a longer recovery time if a varnish host is unable<br>
to reach any backends).<br>
<br>
Paul<br>
<br>
_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>GPG me!!<br><br>gpg --keyserver <a href="http://pool.sks-keyservers.net" target="_blank">pool.sks-keyservers.net</a> --recv-keys F186197B<br><br>
</div>