Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Dear Folks, I have to configure a reverse proxy to redirect the HTTPs Request to another host which is also running HTTPs,,,But I get stuck

Here is the virtualhost configuration on my Apache as the reverse Proxy

<VirtualHost *:80>
        ServerAdmin admin@mydomain.com
        ServerName mail.mydomain.com

RewriteEngine   on
RewriteCond     %{SERVER_PORT} ^80$
RewriteRule     ^(.*)$ https://%{SERVER_NAME}$1 [L,R]

SSLProxyEngine on

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

   ProxyPass / https://192.168.1.6/webmail/
   ProxyPassReverse / https://192.168.1.6/webmail/

    ErrorLog /var/log/apache2/webmail_log
    CustomLog /var/log/apache2/webmail-access_log combined
</VirtualHost>

On my browser I use this address http://mail.mydomain.com

But it only redirect the request to the HTTPs at the reverse proxy server not the HTTPs at the mail host.

Thanks folks

share|improve this question
add comment

1 Answer 1

I haven't setup a https reverse proxy yet but I'm about doing it right now

as far as I can tell your proxy definition is in the wrong place.

Your RewriteRule redirects you away from your http virtual host to your https virtual host, so there's the place where the proxy config has to go.

EDIT: basically I meant this:

remove the proxy from the vhost on port 80

<VirtualHost *:80>
        ServerAdmin admin@mydomain.com
        ServerName mail.mydomain.com

        RewriteEngine   on
        RewriteCond     %{SERVER_PORT} ^80$
        RewriteRule     ^(.*)$ https://%{SERVER_NAME}$1 [L,R]



        ErrorLog /var/log/apache2/webmail_log
        CustomLog /var/log/apache2/webmail-access_log combined
</VirtualHost>

and add it to the vhost listening on port 443 (https)

<VirtualHost *:443>

... other vhost config ....

        SSLProxyEngine on

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

        ProxyPass / https://192.168.1.6/webmail/
        ProxyPassReverse / https://192.168.1.6/webmail/
</VirtualHost>

I haven't tested this exact setup but I think it should work like this...

hth Marcel

share|improve this answer
    
Marcel! did you get it to work? Can you explain the note above, and perhaps give the config? –  user62085 Nov 30 '10 at 22:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.