3

Hello I have the following apache configuration, which is supposed to drive all traffic on port 433 to some balancer that uses a little server called Thin.

<VirtualHost *:443> 
    ServerAdmin webmaster@localhost
    SSLEngine On
        SSLCertificateFile /etc/ssl/private/localhost.pem
    DocumentRoot /home/me/projects/contest/public/

    <Proxy balancer://thinservers>
            BalancerMember http://127.0.0.1:3000
    </Proxy>    
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>

    RewriteEngine On
    # Redirect all non-static requests to thin
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L]

    ProxyPass / balancer://thinservers/
    ProxyPassReverse / balancer://thinservers/
    ProxyPreserveHost on

    ErrorLog ${APACHE_LOG_DIR}/error.log

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

    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Anyway, the URLs I get in the Thin server gets changed from https to http, but I want the Thin server to see them as https. Not sure what's wrong and what to do. Any suggestion?

khelll
  • 141
  • 6

1 Answers1

2

This is a guess, but I think you might need to use this: SSLProxyEngine ON before the block.

From here: http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#sslproxyengine

opsguy
  • 781
  • 1
  • 4
  • 12
  • 1
    He'll also need to change his `BalancerMember` definition from http:// to https://, but `SSLProxyEngine On` is the harder-to-find piece of the puzzle – DerfK May 31 '11 at 01:30
  • Well since the https runs on the port 443, for this case it seems a bit illogical to change the BalancerMember definition to https for a given port. I used RequestHeader set X_FORWARDED_PROTO 'https' with SSLProxyEngine ON and It seems it's workking – Onur Kucukkece Nov 21 '14 at 07:17