This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
Nginx Deployment
keyvanfatehi edited this page Jan 20, 2013
·
2 revisions
With NGINX we need to ensure our rack application file structure is such that the public folder is in the same folder as the config.ru folder.
The expected file structure is shown here http://www.modrails.com/documentation/Users%20guide%20Nginx.html#!/deploying_a_rack_app
A symlink is not good enough, it has to be a real copy of the 'public' directory. e.g.
sudo cp -r /usr/local/lib/ruby/gems/1.9.1/gems/octopusci-0.3.12/lib/octopusci/server/public/ /usr/local/lib/ruby/gems/1.9.1/gems/octopusci-0.3.12/public
In addition a 'tmp' folder must exist: sudo mkdir /usr/local/lib/ruby/gems/1.9.1/gems/octopusci-0.3.12/tmp
Finally, your nginx configuration can be as simple as:
user octopusci;
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19;
passenger_ruby /usr/local/bin/ruby;
passenger_user octopusci;
include mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name localhost;
root /usr/local/lib/ruby/gems/1.9.1/gems/octopusci-0.3.12/public;
passenger_enabled on;
}
}