# api/webui
$SERVER["socket"] == ":443" {
  rails_app   = "api"
  rails_root  = "/srv/www/obs/api"
  rails_procs = 5
  # production/development are typical values here
  rails_mode  = "production"

  log_root = "/srv/www/obs/api/log"

  ssl.engine = "enable"
  ssl.pemfile = "/etc/ssl/private/server.pem"
  ssl.ca-file = "/etc/ssl/certs/server.crt"

  include "vhosts.d/rails.inc"
}

# redirect web browsers to https
$SERVER["socket"] == ":80" {
  $HTTP["host"] =~ "(.*)" {
    url.redirect = ( "^/(.*)" => "https://%1/$1" )
  }
}

# ftp download tree
$SERVER["socket"] == ":82" {
  server.document-root = "/srv/obs/repos/"

  dir-listing.activate = "enable"
}

