从为根目录设置的基本身份验证中排除 nagios 目录

Sai*_*fis 4 centos nagios exclude http-basic-authentication apache-2.2

我从 Apache 的根目录获得了基本身份验证。我是这样设置的。

/etc/httpd/conf.d/xxxx.conf

 <Location />
    AuthType Basic
    AuthUserFile xxxxxxxx
    AuthName "Restricted Area"
    Require valid-user
  </Location>
Run Code Online (Sandbox Code Playgroud)

由于此设置是在 root 中设置的,因此它会覆盖 Nagios 的基本身份验证,从而使 Nagios 无法运行。我试图通过执行排除 Nagios 目录

  <Location /nagios>
    Allow from all
    Satisfy any
  </Location>
Run Code Online (Sandbox Code Playgroud)

但是由于它主导了 Nagios 设置,因此禁用了身份验证。

仅排除 Nagios 子目录的正确方法是什么?

小智 5

尝试使用“目录”指令而不是“位置”指令。位置往往具有更广泛的范围,这使得细粒度控制更加困难。