Project

General

Profile

Bug #709

simple vhost default root change incorrectly handled

Added by Anonymous almost 10 years ago. Updated over 7 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
mod_simple_vhost
Target version:
Start date:
Due date:
% Done:

0%

Missing in 1.5.x:

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

Associated revisions

Revision da4e2877 (diff)
Added by stbuehler over 7 years ago

Do not cache default vhost in mod_simple_vhost (#709)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2322 152afb58-edef-0310-8abb-c4023f1b3aa9

History

#1 Updated by stbuehler over 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 over 7 years ago

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

Fixed in r2322

Also available in: Atom