Types

Roberto O. Fernández Crisial roberto.fernandezcrisial at gmail.com
Tue Jun 28 19:38:49 CEST 2011


Flavio,

I need to use  "if (req.http.host == server.ip)" because I had a lot of
servers using the same VCL. Those servers are behind a HW balancer, which
tests servers' status asking their IP addres, like:

HEAD / HTTP/1.1
Host: www.xxx.yyy.zzz

So I return "error 200" and the balancer understand servers are alive. My
VCL lines are:

if (req.http.host == server.ip)
{
error 200 "Balancer";
}


Regards,
Roberto
@rofc

2011/6/28 Flavio Torres <fla_torres at yahoo.com.br>

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 06/28/2011 01:29 PM, Roberto O. Fernández Crisial wrote:
> > Hi guys,
> >
> > I need to know which should be the best way to use "if
> > (req.http.host == server.ip)" at vcl_recv subrutine with Varnish 3.0?
> > I've been working with this "if" on Varnish 2.1.5 and it works fine.
> > Now, with Varnish 3.0, I got "Comparison of different types: STRING
> > '==' IP" error msg
> >
>
> Hello,
>
> Try:
>
> if (req.http.host == "192.168.0.1") {
> ...
> }
>
> Hope this helps.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk4KDYMACgkQNRQApncg297NagCg4QXu4GP7cM9VdtJjxeDVt5zK
> /VYAoIIsETLFnuozIiaSFJhH1EIfZyed
> =jGdK
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110628/f8227a61/attachment-0003.html>


More information about the varnish-misc mailing list