I have a http service running on

This is delivered as a public https service to https://public.example.com which is via apache proxy magic:

    ServerName public.example.com

    #Configure Reverse Proxy
    ProxyRequests Off
    ProxyPreserveHost On

    <Location />

        Order allow,deny
        Allow from all

    #Define Virtual Host Specific SSL information.
    SSLEngine On
    SSLProxyEngine On
    SSLProxyProtocol all -SSLv2

    SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key


When I enter https://public.example.com in my browser and click through the certificate, I can get the first page which contains a login form:

<form action="http://public.example.com/login" method="post">
  <--  ... contains username, password fields and a send button -->

So the action target was very nice rewritten. But the http should read https. How to do that?

It would be nice if the link was changed in the form action tag, pointing to the correct https page already, rather using a second http virtual host with a rewrite condition.


This is the additional part that solved it (I put it in the vhost but outside the Location container):

SetOutputFilter proxy-html

# On: rewrite also css and javascript - Off: only in HTML
ProxyHTMLExtended Off
# Maybe this should be switched on

ProxyHTMLURLMap http://public.example.com https://public.example.com

You might try http://apache.webthing.com/mod_proxy_html/. It's intended to rewrite URLs in a "proxy situation".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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