Flavio,<div><br></div><div>I will try. Other option is to test "client.ip", as far I know HW balancers' IP address I will show "error 200" to them only.</div><div><br></div><div>Thank you,</div><div>
Roberto</div><div>@rofc<br><br><div class="gmail_quote">2011/6/28 Flavio Torres <span dir="ltr"><<a href="mailto:fla_torres@yahoo.com.br">fla_torres@yahoo.com.br</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>
<div bgcolor="#ffffff" text="#000000"><div class="im">
<br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br></div><div class="im">
On 06/28/2011 02:38 PM, Roberto O. Fernández Crisial wrote:<br>
<span style="white-space:pre-wrap">> 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 href="http://www.xxx.yyy.zzz" target="_blank">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></div>
Roberto,<br>
<br>
Sorry for my misunderstanding. Try server.ip in quotation marks:<div class="im"><br>
<br>
<br>
if (req.http.host == "server.ip"){<br>
error 200 "Balancer";<br>
}<br>
<br>
<br>
<br></div>
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 href="http://localhost/healthcheck_varnish.html" target="_blank">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 href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" target="_blank">"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><div class="im"><br>
<br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.11 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br></div>
iEYEARECAAYFAk4KH3EACgkQNRQApncg2958hACfRulThp9qPHXP7az0ecmkSXT0<br>
nioAn1bqfP4qCOT6yTMB9W4U49Du/iUS<br>
=dAa2<br>
-----END PGP SIGNATURE-----<br>
<br>
</div>
</blockquote></div><br></div>