文档
如何配置 LigHTTPd( aka Lighty) 。
分享一些笔记是因为我没有;没有更好的地方可以放这些笔记。
拒绝访问子目录
# deny access to /data
$HTTP["url"] =~ "^/data" {
url.access-deny = ("")
}将 https 重定向到 https
正在启用 https 上显示。 同时确定您已经装入了 mod_ redirect 。 例如, 在您的 /etc/lighttpd/lighttpd.conf: 中此选项
server.modules = (
...
"mod_redirect",
)然后这个:
# redirect all http to https
$HTTP["scheme"] == "http" {
# capture vhost name with regex conditiona -> %0 in redirect pattern
# must be the most inner block to the redirect rule
$HTTP["host"] =~ ".*" {
url.redirect = (".*" => "https://%0$0")
}
}