Lighttpd:如何对匹配正则表达式的URL进行密码保护
有没有一种方便的方法来对符合特定模式的URL进行密码保护 我考虑过匹配正则表达式,但任何其他创造性的解决方案都会很好 注意:我不是在寻找一种对目录进行密码保护的方法,因为我想要保护的URL并不局限于某个目录结构Lighttpd:如何对匹配正则表达式的URL进行密码保护,url,lighttpd,password-protection,Url,Lighttpd,Password Protection,有没有一种方便的方法来对符合特定模式的URL进行密码保护 我考虑过匹配正则表达式,但任何其他创造性的解决方案都会很好 注意:我不是在寻找一种对目录进行密码保护的方法,因为我想要保护的URL并不局限于某个目录结构 Adam你看过mod\u auth插件了吗 auth.debug = 0 auth.backend = "plain" auth.backend.plain.userfile = "/full/path/to/auth-file.txt" auth.require = ("example
Adam你看过
mod\u auth
插件了吗
auth.debug = 0
auth.backend = "plain"
auth.backend.plain.userfile = "/full/path/to/auth-file.txt"
auth.require = ("example.com" =>
(
"method" => "basic",
"realm" => "Password protected area",
"require" => "user=username"
)
身份验证文件将包含(对于基本身份验证):
更多信息:
要筛选/检查特定目录
$HTTP["url"] =~ "^/download(s)?$" {
auth.require = ( "" =>
(
"method" => "basic",
"realm" => "Passworded Area",
"require" => "user=username"
)
)
}
我添加了一个带有正则表达式的示例。谢谢!这会让我走的。
$HTTP["url"] =~ "^/download(s)?$" {
auth.require = ( "" =>
(
"method" => "basic",
"realm" => "Passworded Area",
"require" => "user=username"
)
)
}