求助一个 lighttpd auth 认证的问题

2021 年 2 月 5 日
 AllenHua

用 openwrt + lighttpd + webdav 搭建了一个 webdav 服务,server 用的 lighttpd, 认证用的 lighttpd-mod-authlighttpd-mod-authn_file

下面是配置文件 /etc/lighttpd/conf.d/20-auth.conf

#######################################################################
##
##  Authentication Module
## -----------------------
##
## See https://redmine.lighttpd.net/projects/lighttpd/wiki/docs_modauth
## for more info.
##
server.modules += ( "mod_auth" )

auth.backend                 = "plain"
auth.backend.plain.userfile  = "/etc/lighttpd/lighttpd.user"
#auth.backend.plain.groupfile = "/etc/lighttpd/lighttpd.group"

#auth.backend.ldap.hostname = "localhost"
#auth.backend.ldap.base-dn  = "dc=my-domain,dc=com"
#auth.backend.ldap.filter   = "(uid=$)"

auth.require               = ( "/" =>
                               (
                                 "method"  => "basic",
                                 "realm"   => "Allen Hua's WebDAV File Server",
                                 "require" => "valid-user"
                               ),
                             )

auth.cache = ("max-age" => "180")

##
#######################################################################

目前达成既定目标,可以正常认证

希望优化的点:

优化成每次都需要认证,或者设置一个缓存时间 5 分钟内才不需要认证(因为通过 frp 内网穿透了 通过外网访问 希望安全一些每次都能认证一下)

看了下 官方文档 https://redmine.lighttpd.net/projects/lighttpd/wiki/docs_modauth 中的 auth.cache 相关的配置,目前在配置文件中给定了配置但没有生效,希望有懂的 v 友给点思路或意见!

感谢阅读。

992 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://v2ex.ih06.com/t/751653

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX