【问题标题】:Apache HTTP Server Location directive - exclude urlApache HTTP 服务器位置指令 - 排除 url
【发布时间】:2012-03-08 11:15:16
【问题描述】:

我有一个 Apache HTTP 服务器,用作 JBoss 部署的 webapp 的代理(通过 https)。我在 conf 文件中有以下条目:

<Location "/app">
    ProxyPass           http://localhost:8080/app
    ProxyPassReverse    http://localhost:8080/app
    AuthType Basic
    AuthName "Private Documentation Repository"
    AuthUserFile <path-to-file>
    Require valid-user
</Location>

如您所见,访问 /app 需要有效用户。 问题是:如何编写一个指令,从 JBoss webapp 中排除一个特定文件,以便访问该文件不需要有效用户,例如:

<Location "/app/some-file.xyz">
    ProxyPass           http://localhost:8080/app/some-file.xyz
    ProxyPassReverse    http://localhost:8080/app/some-file.xyz
</Location>

我的意思是:当用户请求任何内容 (app/) 但 /app/some-file.xyz 时,系统会提示他/她输入密码,否则 Apache 将使用户能够下载 some-file.xyz。任何帮助将不胜感激。

【问题讨论】:

    标签: apache https proxy location


    【解决方案1】:
    <Location "/app/*.xyz">
        allow from all 
        satisfy any 
        ProxyPass           http://localhost:8080/app/*.xyz
        ProxyPassReverse    http://localhost:8080/app/*.xyz
    </Location>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-24
      • 2018-11-08
      • 2015-08-30
      • 2011-12-21
      • 1970-01-01
      • 2019-01-06
      • 1970-01-01
      • 2013-07-02
      相关资源
      最近更新 更多