通过共享托pipe使SSL适用于Ruby on Rails应用程序

我的问题:让我的Ruby on Rails应用程序使用SSL在JustHost共享服务器上运行。

各个部分分别在共享服务器上工作:

  • 我已经build立了我的应用程序,通过cpanel中主机的Phusion Passengerconfiguration工作。 我已经尝试过,没有“生产”标志打勾。
  • 我可以通过http /端口80运行我的应用程序。它一切正常。
  • 我可以访问https /端口443上的安全连接。但是,当我这样做,我只是得到一个目录列表。
  • 我可以在config / production.rb中强制使用config.force_ssl = true的ssl连接,但是我只是被强制转到目录列表。

我的.htaccess文件如下所示:

<IfModule mod_passenger.c> Options -MultiViews PassengerResolveSymlinksInDocumentRoot on #Set this to whatever environment you'll be running in RailsEnv production # following line changes to development or production RackBaseURI /home2/mysite/production/myapp SetEnv GEM_HOME /home2/mysite/ruby/gems PassengerEnabled on </IfModule> 

我的文件设置是这样的:

 ~/public_html/ site --> ~/production/myapp/public site_test --> ~/development/myapp/public 

我的子域名:

  p.mydomain --> ~/public_html/site text.mydomain --> ~/public_html/site_test 

我看到了这个答案: 如何在Ubuntu上使用Apache2和Ruby on Rails设置SSL?

但由于我在共享主机,我不能直接编辑Apacheconfiguration。 我可以使用.htaccess,但我不知道如何处理它。

任何想法都表示赞赏。