The Goal: set up a server that can receive https and http requests from a domain, and forwarded to the rails app running on the server. The rails app is running on localhost:3002, and all attempts to connect to the server are made from a different machine on the internet.
I followed this guide: http://hints.macworld.com/article.php?story=20041129143420344
Here is my virtual host definition
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "/Users/me/projects/myproject/public" ServerName ssl.mydomain.com ServerAlias *.ssl.mydomain.com ProxyPass / http://localhost:3002/ # the rails app forwards all http requests to https </VirtualHost> <VirtualHost *:443> SSLEngine on SSLProxyEngine On RequestHeader set Front-End-Https "On" CacheDisable * SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL DocumentRoot "/Users/me/projects/myproject/public" ServerName ssl.mydomain.com ServerAlias *.ssl.mydomain.com SSLCertificateKeyFile "/private/etc/apache2/certs/webserver.nopass.key" SSLCertificateFile "/private/etc/apache2/certs/newcert.pem" SSLCACertificateFile "/private/etc/apache2/certs/demoCA/cacert.pem" SSLCARevocationPath "/private/etc/apache2/certs/demoCA/crl" ErrorLog "/Users/me/Desktop/ssl.log" ProxyPass / https://localhost:3002/ ProxyPreserveHost on </VirtualHost>
And when I try connecting to the sevre viov the web browser, I get this error:
[Thu Feb 02 16:50:40 2012] [error] (502)Unknown error: 502: proxy: pass request body failed to 127.0.0.1:3002 (localhost) [Thu Feb 02 16:50:40 2012] [error] [client 18.104.22.168] proxy: Error during SSL Handshake with remote server returned by /session/new [Thu Feb 02 16:50:40 2012] [error] proxy: pass request body failed to 127.0.0.1:3002 (localhost) from 22.214.171.124 ()
how do I debug / fix this?
EDIT: the web browser error: ( This error occurred on a remote machine (relative to the server) )
the url I typed in was https://ssl.mydomain.com
EDIT 2: the error that rails throws at me:
Filter chain halted as [:ensure_proper_protocol] rendered_or_redirected. Completed in 0ms (DB: 0) | 302 Found [http://ssl.devtinderbox.com/] [2012-02-03 10:20:45] ERROR bad Request-Line `?p\001\003\001\000W\000\000\000\020\000\0009\000\0008\000\0005\000\000\026\000\000\023\000\000'.
not sure if that's important though, as I think the SSL handshake needs to succeed before rails will know what to do.
I'm using Mac OS X Lion.