#
# usage:
# $HTTP["host"] == "someapp.opensuse.org" {
#   rails_app   = "someapp"
#   rails_root  = "/srv/www/opensuse/someapp"
#   rails_procs = 4
#   # production/development are typical values here
#   rails_mode  = "production"
#   include "vhosts.d/rails.inc"
# }

  url.rewrite += ("^/apidocs(/|)$" => "/apidocs/html/index.html")
  magnet.attract-physical-path-to = ( conf_dir + "/cleanurl-v5.lua" )
  accesslog.filename              = log_root + "/obs-" + rails_app + "-access.log"
  rails_tmp   = rails_root + "/tmp"

  server.document-root  = rails_root + "/public"
  fastcgi.server = ( ".fcgi" =>
    ( rails_app =>
      ( "socket"          => rails_tmp + "/sockets/fcgi.socket",
        "bin-path"        => server.document-root + "/dispatch.fcgi",
        "bin-environment" => (
           "RAILS_ENV" => rails_mode,
           "TMP"       => rails_tmp 
        ),
        "max-procs"       => rails_procs,
        "idle-timeout"    => 3600,
      )
    )
  )

