<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
On 06/28/2011 02:38 PM, Roberto O. Fernández Crisial wrote:<br>
<span style="white-space: pre;">> Flavio,<br>
> <br>
> I need to use "if (req.http.host == server.ip)" because I
had a<br>
> lot of servers using the same VCL. Those servers are behind
a HW <br>
> balancer, which tests servers' status asking their IP
addres,<br>
> like:<br>
> <br>
> HEAD / HTTP/1.1 Host: <a class="moz-txt-link-abbreviated" href="http://www.xxx.yyy.zzz">www.xxx.yyy.zzz</a><br>
> <br>
> So I return "error 200" and the balancer understand servers
are <br>
> alive. My VCL lines are:<br>
> <br>
> if (req.http.host == server.ip) { error 200 "Balancer"; }<br>
> </span><br>
<br>
<br>
Roberto,<br>
<br>
Sorry for my misunderstanding. Try server.ip in quotation marks:<br>
<br>
<br>
if (req.http.host == "server.ip"){<br>
error 200 "Balancer";<br>
}<br>
<br>
<br>
<br>
Btw, here I'm using the following vcl for the same purpose:<br>
<br>
vcl_recv {<br>
...<br>
if (req.url == "/healthcheck_varnish.html") {<br>
error 200 "LIVE";<br>
}<br>
...<br>
}<br>
<br>
<br>
$ curl -H "Host: 127.0.0.1"
<a class="moz-txt-link-freetext" href="http://localhost/healthcheck_varnish.html">http://localhost/healthcheck_varnish.html</a><br>
<br>
<?xml version="1.0" encoding="utf-8"?><br>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br>
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"</a>><br>
<html><br>
<head><br>
<title>200 LIVE</title><br>
</head><br>
<body><br>
<h1>Error 200 LIVE</h1><br>
<p>LIVE</p><br>
<h3>Guru Meditation:</h3><br>
<p>XID: 1871742327</p><br>
<hr><br>
<p>Varnish cache server</p><br>
</body><br>
</html><br>
<br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.11 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a class="moz-txt-link-freetext" href="http://enigmail.mozdev.org/">http://enigmail.mozdev.org/</a><br>
<br>
iEYEARECAAYFAk4KH3EACgkQNRQApncg2958hACfRulThp9qPHXP7az0ecmkSXT0<br>
nioAn1bqfP4qCOT6yTMB9W4U49Du/iUS<br>
=dAa2<br>
-----END PGP SIGNATURE-----<br>
<br>
</body>
</html>