httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emanuele Bastianelli <manu.re...@gmail.com>
Subject [users@httpd] Apache 2.4 reverse proxy with digest authentication and macros
Date Mon, 12 Sep 2016 20:34:03 GMT
Hi,

I'm having a problem configuring Apache 2.4 as a reverse proxy with Digest
Authentication. The strange behaviour is that if I activate the reverse
proxy directives, the authentication stops working.
For design reasons, I'm using mod_macro. These are my config files:

macro.conf

<Macro RequestedURI $request_uri>
        <Location ~ "^$request_uri">
                AuthName $request_uri
                AuthType Digest
                AuthDigestAlgorithm MD5
                AuthDigestDomain /
                AuthDigestProvider dbd
                AuthDBDUserRealmQuery "SELECT password FROM password WHERE
username = %s AND realm = %s"
                Require valid-user

                ProxyPass http://localhost:9000/$request_uri/
                ProxyPassReverse http://localhost:9000/$request_uri/
                Require all granted
        </Location>
</Macro>

000-default.conf

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        ProxyPreserveHost On
        RewriteEngine on

        DBDriver mysql
        DBDParams "host=localhost port=3306 user=myuser pass=mypass
dbname=apacheauth"
        DBDMin  2
        DBDKeep 4
        DBDMax  10
        DBDExptime 300

        Use RequestedURI /test
        Use RequestedURI /othertest

</VirtualHost>

Without ProxyPreserveHost, RewriteEngine, ProxyPass and ProxyPassReverse, the
authentication works perfectly.
Any hint?

Thanks in advance

Mime
View raw message