V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nnic
V2EX  ›  Apache

求教 apache 反向代理配置

  •  
  •   nnic · 2015-09-10 11:57:26 +08:00 · 2138 次点击
    这是一个创建于 3143 天前的主题,其中的信息可能已经有所发展或是发生改变。

    服务器 A 反向代理请求到 服务器 B
    想要在 B 上面设置 basic 认证,且某些 client ip 可以不需要认证

    服务器上面 A 的反向代理要如何配置

    1 条回复    2015-09-10 14:31:10 +08:00
    nnic
        1
    nnic  
    OP
       2015-09-10 14:31:10 +08:00
    我来自问自答好了
    在 B 服务器上面配置

    SetEnvIf X-Forwarded-For "^192\.168\." allowedIP
    AuthType Basic
    AuthName "Admin Login"
    AuthUserFile /etc/htpasswdFile
    Require valid-user
    Order allow,deny
    Allow from env=allowedIP
    Satisfy any
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3528 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:09 · PVG 08:09 · LAX 17:09 · JFK 20:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.