Rails 3.1 SSL重定向循环

时间:2012-01-25 15:30:09

标签: ruby-on-rails ruby-on-rails-3 apache jboss jruby

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

更新 好的,再次部署之后我还有一些信息。当网页被点击时,该网站目前托管在https://ibs.collegegreen.net/Campus-Commerce上,我收到重定向循环错误,最终解析为https://ibs.collegegreen.net/Campus-Commerce//////////////////////

此外,我们还有一台Apache服务器将请求代理回JBoss服务器。

[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

1 个答案:

答案 0 :(得分:1)

我们发现了这个问题,就是Apache。我们发现以下链接与调整Apache http://forum.webfaction.com/viewtopic.php?id=995

相关