O objetivo:
configure um servidor que possa receber solicitações https e http de um domínio e encaminhe para o aplicativo rails em execução no servidor. O aplicativo rails está sendo executado no host local: 3002 e todas as tentativas de conexão com o servidor são feitas a partir de uma máquina diferente na Internet.
Eu segui este guia:
link
Aqui está minha definição de host virtual
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>
E quando eu tento conectar ao sevre viov o navegador da web, recebo este erro:
[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 96.11.81.39] 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 96.11.81.39 ()
como faço para depurar / corrigir isso?
EDIT: o erro do navegador da Web: (Este erro ocorreu em uma máquina remota (em relação ao servidor))
a URL que eu digitei foi link
EDIT2:oerroqueostrilhoslançamemmim:
Filterchainhaltedas[:ensure_proper_protocol]rendered_or_redirected.Completedin0ms(DB:0)|302Found[http://ssl.devtinderbox.com/][2012-02-0310:20:45]ERRORbadRequest-Line'?pNameVirtualHost*: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>
1[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 96.11.81.39] 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 96.11.81.39 ()
3Filter 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%pre%1%pre%3%pre%1%pre%0W%pre%0%pre%0%pre%00%pre%0%pre%09%pre%0%pre%08%pre%0%pre%05%pre%0%pre%06%pre%0%pre%03%pre%0%pre%0'.
1%pre%0W%pre%0%pre%0%pre%00%pre%0%pre%09%pre%0%pre%08%pre%0%pre%05%pre%0%pre%06%pre%0%pre%03%pre%0%pre%0'.
não tenho certeza se isso é importante, pois acho que o handshake SSL precisa ser bem-sucedido antes que o rails saiba o que fazer.
Estou usando o Mac OS X Lion.