Skip to content
Xu Tao edited this page Nov 14, 2013 · 1 revision

Nginx

upstream myapp {
  server 127.0.0.1:2000;
}

server {
  listen   80;
  server_name beta.wanmen.org;

  root     /root/cats2000;
  index    index.html;

  location / {
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header  Host $http_host;
    proxy_redirect  off;
    try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby;
  }

  location @ruby {
    proxy_pass http://myapp;
  }
}

Static File

RAILS_ENV="production" rake assets:precompile

Run rails

rails server -e production -p 2000 -d

Clone this wiki locally