Bug #709
closedsimple vhost default root change incorrectly handled
Description
It appears that if I change simple vhost default host (eg. a specific default host for a specific ip range), the server doesn't serve default host if an invalid vhost was attempted to be reached, unless the default host itself has been accessed at least once before, and the original default host is served instead.
Steps to reproduce are, apparently:
a)
{{{
simple-vhost.server-root = "/srv/www-vhosts/
simple-vhost.default-host = "some.domain.tld"
simple-vhost.document-root = "/"
}}}
b)
{{{
$HTTP[[remoteip]] == "192.168.0.0/16" {
simple-vhost.default-host = "another.tld"
} # the ip range is just sample, obviously
}}}
and restart server
c)
{{{
mkdir -p /srv/www-vhosts/{some.domain.tld,another.tld}
}}}
d) from ip within range of 192.168.0.0/16:
{{{
echo -ne "GET / HTTP/1.0\r\nHost: nonexistent.tld\r\n\r\n" | netcat the.http.server 80
}}}
e) This will serve "some.domain.tld" instead of "another.tld"
f)
{{{
echo -ne "GET / HTTP/1.0\r\nHost: another.tld\r\n\r\n" | netcat the.http.server 80
}}}
g) This will properly serve another.tld
h) Repeat d) and it will properly serve another.tld
-- iSteve
Updated by stbuehler over 16 years ago
The caching fails; so perhaps we shouldn't cache for the default vhost. I don't caching is needed anyway, as a stat call for the last used vhost shouldn't be a big performance hit - the kernel should have that information still in the cache anyway.
Updated by stbuehler about 16 years ago
- Status changed from New to Fixed
- Resolution set to fixed
Fixed in r2322
Also available in: Atom