lighttpd auth-require 基于每个主机

lighttpd auth-require 基于每个主机

是否可以使用auth.require类似下面的主机条目指令?

$HTTP["host"] =~ "db\.example\.com$" {
    server.document-root = "/usr/share/phpmyadmin"
    server.errorlog = "/var/log/lighttpd/db.example.com/error.log"
    accesslog.filename = "/var/log/lighttpd/db.example.com/access.log"
    server.error-handler-404 = "/e404.php"
}

每次我尝试使用auth.require其中一个语句时,都会得到一个无效的配置文件。

答案1

抱歉。毕竟是打字错误。以下内容运行良好:

$HTTP["host"] =~ "db\.example\.com$" {
    server.document-root = "/usr/share/phpmyadmin"
    server.errorlog = "/var/log/lighttpd/db.example.com/error.log"
    accesslog.filename = "/var/log/lighttpd/db.example.com/access.log"
    server.error-handler-404 = "/e404.php"
    auth.require = ( "" => (
    "method"  => "digest",
    "realm"   => "dbuser",
    "require" => "valid-user"
    ))
}

相关内容