disable auth digest para proxy reverso

2

Eu tenho a autenticação de resumo configurada em um dos meus domínios, mas gostaria de desativá-la para um proxy reverso.

<VirtualHost *:80>
    ServerName example.org
    DocumentRoot /var/www/
    <Directory /var/www/>
            BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
            AuthType Digest
            AuthName "Internal"
            AuthDigestDomain http://example.org/
            AuthDigestProvider file
            AuthUserFile /etc/apache2/example.digest
            Require valid-user

            Options FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

    ExpiresActive On
    ExpiresDefault "access plus 7 days"

    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass /api/ http://api.otherdomain.com/ retry=0 nocanon
    ProxyPassReverse /api/ http://api.otherdomain.com/
    AllowEncodedSlashes On

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

Como você pode ver, tentei, sem sucesso, usar um bloco <Proxy> para Satisfazer Qualquer.

    
por Hobozilla 17.07.2014 / 08:28

1 resposta

2

Eu acho que você resolveu seu problema de uma maneira bem universal colocando sua configuração de proxy reverso dentro de uma tag <Location> e fazendo uso de como o Apache internamente mescla diretivas e define precedência .

As diretivas

<Location> são aplicadas por último e devem anular a diretiva <Directory> .

<VirtualHost *:80>
    ServerName example.org
    DocumentRoot /var/www/
    <Directory /var/www/>
            BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
            AuthType Digest
            AuthName "Internal"
            AuthDigestDomain http://example.org/
            AuthDigestProvider file
            AuthUserFile /etc/apache2/example.digest
            Require valid-user

            Options FollowSymLinks MultiViews
            AllowOverride All

    </Directory>

    ExpiresActive On
    ExpiresDefault "access plus 7 days"

    <Location /api/>   
            Order allow,deny
            Allow from all

            ProxyPreserveHost On
            ProxyPass http://api.otherdomain.com/ retry=0 nocanon
            ProxyPassReverse http://api.otherdomain.com/
            AllowEncodedSlashes On
    </Location> 
</VirtalHost>

Do Apache 2.3 você pode usar contêineres de autorização para expressar uma lógica de autorização mais complexa.

    
por 17.07.2014 / 17:32