Bug #1676
Order of nested conditionals (remoteip - host)
| Status: | Fixed | Start: | ||
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | core | |||
| Target version: | 1.4.20 | |||
| Pending: | Resolution: | fixed |
||
Description
Hi all,
we used to write this in lighty's config (1.4.17/18):
var.allowedip = "192\.168\.10\.\d{1,3}"
$HTTP["remoteip"] =~ var.allowedip {
$HTTP["host"] == "vhost1.srv.tld" {
...vserver-config...
}
$HTTP["host"] == "vhost2.srv.tld" {
...vserver-config...
}
}
But with 1.4.19 (from Debian backports), this stopped working. We now
have to use something like this:
var.allowedip = "192\.168\.10\.\d{1,3}"
$HTTP["host"] == "vhost1.srv.tld" {
$HTTP["remoteip"] =~ var.allowedip {
...vserver-config...
}
}
$HTTP["host"] == "vhost2.srv.tld" {
$HTTP["remoteip"] =~ var.allowedip {
...vserver-config...
}
}
It seems that the host conditional has to be the outermost one. There's also a logical difference in these 2 approaches:
- in the first one, there's just no V-Server for the IP's in var.privhosts
- in the second one, there is a V-Server, but it's using the global settings.
Is this a Bug or the desired behavior???
At least, this behaviour should be documented somewhere.
-- laph