server.ip for "undoing" namevirtualhosts issues
Poul-Henning Kamp
phk at phk.freebsd.dk
Mon Jul 12 09:46:40 CEST 2010
In message <4C3AAFE7.3010306 at d6.com>, Chris Hecker writes:
>Can I use server.ip in vcl_recv to force the host to the right site if
>there's no host record? What would the code look like to do this?
>Something like:
>
>if(!req.http.host) {
> if(server.ip == "a.b.c.d") {
> set req.http.host = "a.com";
> } elsif(server.ip == "a.b.c.e") {
>...etc
Yes, that is server.ip was intended to be used.
If that does not work, it is a bug.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the varnish-misc
mailing list