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 <[email protected]>

>
> -----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-----
>
>
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
  • Types Roberto O . Fernández Crisial

Reply via email to