reverse proxy not rewriting to https

Posted by polishpt on Server Fault See other posts from Server Fault or by polishpt
Published on 2012-03-18T11:59:58Z Indexed on 2012/03/19 2:05 UTC
Read the original article Hit count: 382

Filed under:
|
|

I need your help. I'm having problems with reverse proxy rewriting to https:

I have an alfresco app running on top of tomcat and as a front and an Apache server - it's site-enabled looks like that:

    <VirtualHost *:80>
    ServerName alfresco

    JkMount /* ajp13_worker


    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined
    ServerSignature Off
    </VirtualHost>

I also have a reverse proxy server running on second machine and i want it to rewrite queries to https. It's site-enabled looks like that:

    <VirtualHost 192.168.251.50:80>
    ServerName alfresco

    DocumentRoot /var/www/


    RewriteEngine on
    RewriteRule (.*) https://alfresco/  [R]

    LogLevel warn
    ErrorLog  /var/log/apache2/alfresco-80-error.log
    CustomLog /var/log/apache2/alfresco-80-access.log combined
    ServerSignature Off
    </VirtualHost>


    <VirtualHost 192.168.251.50:443>
    ServerName alfresco

    DocumentRoot /var/www/

    SSLEngine On
    SSLProxyEngine On
    SSLCertificateFile      /etc/ssl/certs/alfresco.pem
    SSLCertificateKeyFile   /etc/ssl/private/alfresco.key

    SetEnvIf User-Agent ".*MSIE.*"  nokeepalive ssl-unclean-shutdown \
                                    downgrade-1.0 force-response-1.0

    ProxyRequests Off
    ProxyPreserveHost On

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

    ProxyPass /alfresco       http://192.168.251.50:8080/alfresco
    ProxyPassReverse /alfresco http://192.168.251.50:8080/alfresco

    LogLevel warn
    ErrorLog /var/log/apache2/alfresco-443-error.log
    CustomLog /var/log/apache2/alfresco-443-access.log combined
    ServerSignature Off
    </VirtualHost>

Now, ProxyPass works, when I go to alfresco/alfrsco in a browser application opens, but rewriting to https doesn't work.

Plese help.

Regards


when I go to 192.168.251.50 Tomcat configuration page shows up. When I go to 192.268.251.50:8080 - the same as above when I go to 192.168.251.50:8080/alfresco - alfresco app page shows app when I go to alfresco/alfresco - same as above when i go to https://alfresco or https://alfresco i get an error connecting to a server

© Server Fault or respective owner

Related posts about apache2

Related posts about apache-tomcat