我希望不同的路线有自己的密码。所以我有一个LocationMatch
:
<LocationMatch /shiny/(?<appname>.*)>
AuthType Basic
AuthName "Enter your login name and password"
AuthUserFile "/path/to/directory/with/passwords/.%{env:MATCH_APPNAME}.pwd"
Require valid-user
</LocationMatch>
但是我收到 500 内部服务器错误,因为%{env:MATCH_APPNAME}
未评估:
[Thu Sep 20 12:11:21.678370 2018] [authn_file:error] [pid 16932:tid 140332725917440] (2)No such file or directory: [client xxx.xxx.xxx.xxx:52274] AH01620: Could not open password file: /path/to/directory/with/passwords/.%{env:MATCH_APPNAME}.pwd
我正在遵循官方说明这里。我做错了什么?谢谢。
apache2版本:apache2 (OpenRC) 0.34.11 (Gentoo Linux)