Bug #41
closed
Added by jan about 20 years ago.
Updated about 18 years ago.
Description
Allow and handle:
$HTTP["host"] == "www.example.org" {
$HTTP["url"] =~ "^/base/" {
...
}
}
- Status changed from New to Fixed
- Resolution set to fixed
added by Xuefer in changeset r298 and ongoing
- Status changed from Fixed to Need Feedback
- Resolution deleted (
fixed)
A similar problem exists with {{{ $HTTPhost }}} and {{{ $SERVERsocket }}}
This works:
$HTTP["host"] == "server" {
$SERVER["socket"] == "IP:443" {
# ...
}
}
But this leads to a timeout in the web browser:
$SERVER["socket"] == "IP:443" {
$HTTP["host"] == "server" {
# ...
}
}
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.
- Status changed from Need Feedback to Fixed
- Resolution set to fixed
fixed in r1792, r1795 and r1807
Also available in: Atom