2010-12-13 74 views
14

我有一个HTTP Basic安全网站。我用mod_proxy隐藏Tomcat应用程序服务器。我可以删除HTTP基本标头吗? Tomcat应用程序读取标题并返回401未经授权。因为应用程序使用cookie会话,所以不需要基本身份验证。所以我认为只要删除标题就没问题。使用Apache mod代理删除基本身份验证标头

回答

24

确保mod_headers中被启用。比如说配置:

<VirtualHost *:80> 
     ServerName something.example.com 
     ServerAdmin [email protected] 

     ProxyRequests Off 
     ProxyPreserveHost Off 
     AllowEncodedSlashes On 
     KeepAlive Off 

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

     <Location /> 
       AuthType Basic 
       AuthName "Authorized Users Only" 
       AuthUserFile /etc/apache2/passwd 
       Require valid-user 
     </Location> 

     RequestHeader unset Authorization 
     ProxyPass/http://localhost:5984/ example 
     ProxyPassReverse/http://localhost:5984/ 

     ErrorLog /var/log/apache2/something.example.com-error_log 
     CustomLog /var/log/apache2/something.example.com-access_log common 
</VirtualHost> 
与代理
10

我有同样的问题与Apache在另一个Java服务器试图做的基本认证的前面,添加以下到我的Apache配置似乎解决它:

RequestHeader unset Authorization 
+0

在一起吗?或者什么是父元素? – Jan 2011-02-16 20:00:55

+0

thx。这对于使用weblogic连接器的apache 2.4来说已经足够了。 – realgt 2016-06-01 14:13:38