Apache HTTP Server Location指令 - 排除url

时间:2012-03-08 11:15:17

标签: apache https proxy location

我有一个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。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

<Location "/app/*.xyz">
    allow from all 
    satisfy any 
    ProxyPass           http://localhost:8080/app/*.xyz
    ProxyPassReverse    http://localhost:8080/app/*.xyz
</Location>