在安装SSL后,在生产模式中显示Rails开发样式错误

时间:2013-12-23 08:22:59

标签: ruby-on-rails apache ssl varnish

安装SSL证书后,我看到生产中存在扩展的开发风格错误(而不是简单的“出错”)。 我在Varnish面前使用Apache和Varnish以及Apache作为SSL终结器。这是我的虚拟主机文件:

<VirtualHost *:443>
   ServerName my.domain
   ServerAlias www.my.domain
   SSLEngine On
   SSLProtocol all -SSLv2
   SSLCertificateFile /path/mydomain.crt
   SSLCertificateKeyFile /path/mydomain.key
   SSLCertificateChainFile /path/mydomain.ca-bundle

   ProxyRequests       Off
   ProxyPreserveHost On
   ProxyPass           /       http://localhost:80/
   ProxyPassReverse    /       http://localhost:80/
   RequestHeader set X-Forwarded-Proto 'https'
   SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
   SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

   DocumentRoot /path/to/public
   <Directory /path/to/public>
      Allow from all
      Options -MultiViews
   </Directory>
 </VirtualHost>

1 个答案:

答案 0 :(得分:1)

建议here的解决方法有所帮助。但是,我还是不明白这件事是什么。

在初始化程序中:

class ActionDispatch::Request
  def local?
   false
  end
end