nginx-related conf


upstream domain_management {
  server 127.0.0.1:8000;
  server 127.0.0.1:8001;
  server 127.0.0.1:8002;
  server 127.0.0.1:8003;
  server 127.0.0.1:8004; 
  server 127.0.0.1:8005;
  server 127.0.0.1:8006; 
  server 127.0.0.1:8007;
}
server {
  # port to listen on. Can also be set to an IP:PORT
  listen 81 default;
  # Set the max size for file uploads to 50Mb
  client_max_body_size 50M;
  # sets the domain[s] that this vhost server requests for
  server_name servername.com;
  # doc root
  root /home/domain_management/public;
  # vhost specific logs
  access_log  /home/domain_management/log/domain_management.access.log main;
  error_log   /home/domain_management/log/domain_management.error.log notice;
  # this rewrites all the requests to the maintenance.html
  # page if it exists in the doc root. This is for capistrano's
  # disable web task
  if (-f $document_root/system/maintenance.html) {
    rewrite  ^(.*)$  /system/maintenance.html last;
    break;
  }
  # Block access to paths containing .svn
  location ~* ^.*\.svn.*$ {
    internal;
  }
  location / {
    index  index.html index.htm;
    # Forward the user's IP address to Rails
    proxy_set_header          X-Real-IP  $remote_addr;
    # needed for HTTPS
    proxy_set_header          X_FORWARDED_PROTO https;
    proxy_set_header          X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header          Host $http_host;
    proxy_redirect            false;
    proxy_max_temp_file_size  0;
    location ~ ^/(images|javascripts|stylesheets)/ {
      expires 10y;
    }
    if (-f $request_filename) {
      break;
    }
    if (-f $request_filename/index.html) {
      rewrite (.*) $1/index.html break;
    }
    if (-f $request_filename.html) {
      rewrite (.*) $1.html break;
    }
    if (!-f $request_filename) {
      proxy_pass http://domain_management;
      break;
    }
  }
  error_page   500 502 503 504  /500.html;
  location = /500.html {
    root /home/domain_management/public;
  }
}

mongrel_cluster.yml


--- 
cwd: /home/domain_management/
address: 127.0.0.1
port: "8000"
servers: 8
user: mongrel
group: mongrel
environment: production
pid_file: /var/run/mongrel_cluster/mongrel.pid
log_file: /home/domain_management/log/mongrel.log