server.modules += ("mod_cgi")
server.modules += ("mod_auth")
server.modules += ("mod_alias")
server.modules += ("mod_setenv")

$HTTP["url"] =~ "^/icinga/cgi-bin/" {
        dir-listing.activate = "disable" 
        cgi.assign = ( ".cgi" => "" )
}

$HTTP["url"] =~ "^/icinga/" {
        auth.backend = "htpasswd" 
        auth.backend.htpasswd.userfile = "/usr/local/icinga/etc/htpasswd.users" 
        auth.require += ( "" =>
                (
                        "method"  => "basic",
                        "realm"   => "Icinga Access",
                        "require" => "valid-user" 
                )
        )
        setenv.add-environment = ( "REMOTE_USER" => "user" )
}

alias.url += (
        "/icinga/cgi-bin" => "/usr/local/icinga/sbin",
        "/icinga"         => "/usr/local/icinga/share" 
)
