18

HTTP Basic で保護された Web サイトを持っています。mod_proxy で Tomcat アプリケーション サーバーを非表示にします。HTTP Basic ヘッダーを削除できますか? Tomcat アプリケーションはヘッダーを読み取り、401 notauthorized を返します。アプリケーションは Cookie セッションを使用するため、基本認証は必要ありません。したがって、ヘッダーを削除するだけで問題ないと思います。

4

2 に答える 2

28

mod_headersが有効になっていることを確認してください。設定例:

<VirtualHost *:80>
        ServerName something.example.com
        ServerAdmin admin@example.com

        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>
于 2011-04-14T19:27:04.970 に答える
15

基本認証を実行しようとしている別の Java サーバーの前にある Apache で同じ問題が発生しました。Apache 構成に以下を追加すると、問題が解決したようです。

RequestHeader unset Authorization
于 2011-02-14T19:38:10.077 に答える