Bug #709

simple vhost default root change incorrectly handled

Added by Anonymous over 9 years ago. Updated about 7 years ago.

Status:FixedStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:1.4.21
Missing in 1.5.x:


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 = "/"

$HTTP[[remoteip]] == "" {
simple-vhost.default-host = "another.tld"
} # the ip range is just sample, obviously
and restart server
mkdir -p /srv/www-vhosts/{some.domain.tld,another.tld}
d) from ip within range of
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"
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


#1 Updated by stbuehler about 7 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.

#2 Updated by stbuehler about 7 years ago

  • Status changed from New to Fixed
  • Resolution set to fixed

Fixed in r2322

Also available in: Atom