Version 1 (modified by JuergeN, 13 years ago) (diff)


Configuring Apache2 Server as SSL Proxy with htdigest auth

Load the required modules

a2enmod ssl proxy proxy_http

Create file deepamehta in /etc/apache2/sites-available:

<VirtualHost *:443>
    ServerName deepamehta.yourdomain.tld
    ServerAdmin postmaster@yourdomain.tld

    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/deepamehta.yourdomain.tld.pem

    ErrorLog /var/log/apache2/deepamehta-error.log
    CustomLog /var/log/apache2/deepamehta-access.log combined
    RewriteEngine On 
    RewriteRule ^/?$ http://localhost:8080/index.html [P] 
    ProxyRequests Off
    ProxyPreserveHost Off
    ProxyStatus On
    <Proxy *>
	Order deny,allow
        Allow from all
    <location />
	Order allow,deny
	Allow from all
	AuthType Digest
	AuthName "deepamehta.yourdomain.tld"
	AuthUserFile /etc/apache2/.htdigest
	Require valid-user
	ProxyPass http://localhost:8080/
	ProxyPassReverse http://localhost:8080/


Create link to /etc/apache2/sites-available/deepamehta in /etc/apache2/sites-enabled and restart the webserver ...