基于ip的Apache 2单独的auth

时间:2016-04-03 17:55:15

标签: apache

ProxyPreserveHost On

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

<Location />
    Order deny,allow
    Deny from all
    AuthType basic
    AuthName "Secured Site"
    AuthBasicProvider "google_authenticator"
    Require valid-user
    GoogleAuthUserPath /etc/apache2/ga_auth
    GoogleAuthCookieLife 3600
    GoogleAuthEntryWindow 1
    Allow from 10.0.0.1/24
    Satisfy Any
</Location>

以上是我当前的Apache配置。如果没有从我的网络中连接,它正在做的是需要用户名和密码。密码是用户密码和Google身份验证器代码拼凑在一起的组合,因为只有1个密码字段。这很有效。

但我真正希望它的工作方式与目前网络外部的工作方式相同。但是从我的网络内部我希望它需要一个密码,只需要密码而不是Google身份验证器代码。换句话说,有没有办法根据ip进行单独的位置配置?

顺便说一下,我使用apache作为反向代理而没有别的。我不知道如何轻松地在NGINX上设置Google身份验证器,这就是我使用Apache的原因。如果另一项服务比我耳朵好!感谢。

0 个答案:

没有答案
相关问题