Project

General

Profile

Actions

Bug #1676

closed

Order of nested conditionals (remoteip - host)

Added by Anonymous almost 16 years ago. Updated over 15 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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

Actions #1

Updated by stbuehler almost 16 years ago

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

Fixed in r2147.

Actions

Also available in: Atom