2012-01-25 42 views
1

和往常一样,我在将Rails应用程序部署到不同的临时环境时遇到了一些奇怪的问题。我已经配置了我的Rails 3.1应用程序以使用SSL config.force_ssl = true。当我捣乱项目时,战争会正确地部署到我们的测试JBoss服务器(4.2.2),并且可以通过https访问。当我转向生产时,应用程序无法访问,并提供以下消息。Rails 3.1 SSL重定向循环

UPDATE 好的,再次部署后我有更多的信息。该网站上目前https://ibs.collegegreen.net/Campus-Commerce托管网页时被击中,我接受,最终解析为https://ibs.collegegreen.net/Campus-Commerce//////////////////////

另外一个重定向循环错误,我们有代理请求回到我们的JBoss服务器Apache服务器。

[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp//] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp///] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp////] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp/////] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp//////] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp///////] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp////////] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp/////////] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp//////////] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp///////////] miss 
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/MyApp]] cache: [GET /MyApp////////////] miss 

production.rb

MyApp::Application.configure do 
    # Settings specified here will take precedence over those in config/application.rb 

    # Code is not reloaded between requests 
    config.cache_classes = true 

    # Full error reports are disabled and caching is turned on 
    config.consider_all_requests_local  = false 
    config.action_controller.perform_caching = true 

    # Disable Rails's static asset server (Apache or nginx will already do this) 
    config.serve_static_assets = false 

    # Compress JavaScripts and CSS 
    config.assets.compress = true 

    # Don't fallback to assets pipeline if a precompiled asset is missed 
    config.assets.compile = true 

    # Generate digests for assets URLs 
    config.assets.digest = true 

    config.assets.js_compressor = :closure 

    # Defaults to Rails.root.join("public/assets") 
    #config.assets.manifest = Rails.root.join("config") 

    # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 
    config.force_ssl = true 

    #config.assets.precompile += [ '*.js', 'cc/*.js', '*.css', 'skins/*.css', 'smoothness/*.css' ] 
    config.assets.precompile += %w(*.css *.js) 

    # Enable threaded mode 
    config.threadsafe! 

    # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 
    # the I18n.default_locale when a translation can not be found) 
    config.i18n.fallbacks = true 

    # Send deprecation notices to registered listeners 
    config.active_support.deprecation = :notify 

end 

回答