Bug #41
nested conditionals
| Status: | Fixed | Start: | ||
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | core | |||
| Target version: | 1.5.0 | |||
| Pending: | Resolution: | fixed |
||
Description
Allow and handle:
$HTTP["host"] == "www.example.org" {
$HTTP["url"] =~ "^/base/" {
...
}
}
Associated revisions
fixed failing nesting and else-handling introduced in the last changes
(fixes #41)
History
05/01/2005 02:20 AM - jan
- Status changed from New to Fixed
- Resolution set to fixed
added by Xuefer in changeset r298 and ongoing
10/13/2006 12:54 PM - Anonymous
- Status changed from Fixed to Need Feedback
- Resolution deleted (
fixed)
Nesting, the other way round ($HTTPhost inside $HTTPurl) doesn't work. See
http://forum.lighttpd.net/topic/2561
-- johannes.beigel
02/27/2007 02:23 PM - Anonymous
I have severe trouble with nested conditions. I have "hand made" virtual hosting like indicated below:
server.document-root = "/var/www/default"
$HTTP["host"] =~ "^(host1|host2|host3|...)$" {
server.document-root = "/var/www/real-content"
$HTTP["url"] =~ "^/_admin" {
$HTTP["remoteip"] !~ "(^1.2.3.|172.16|172.17|172.18)" {
url.access-deny = ( "" )
}
$SERVER["socket"] == "2.3.4.5:80" {
url.redirect = ( "/.*" => "https://mgmthost/_admin/" )
}
}
}
$HTTP["host"] =~ "^host5$" {
... something else here...
}
$HTTP["url"] =~ "^/server.*" {
$HTTP["remoteip"] != "1.2.3.0/24" {
url.access-deny = ( "" )
}
}
Observations:
- The url.access-deny in the first clause is never executed. I can access the pages under `/_admin/` from anywhere.
- The redirect is also never executed (SSL works fine if I happen to enter the correct https:// URL).
- If I chain the conditions like this: `$HTTPhost {} else $HTTPremoteip { ... }`
Then not even the server.document-root in the first $HTTP clause gets executed, and the whole virtual hosting breaks down in the process.
- ANY attempt to limit the access to /server-status etc (see the last clause) was ignored, too. I was unable to figure out how to make it work, neither in global context, nor nested within something else.
Also, swapping the conditions didn't help any, too.
I'm a bit at a loss as to how to cope with this, and/or which bug(s) this should be (1, 2, something else?).
At least, I'd say that this bug is still valid.