Nginx config for Ruby on Rails

27 Aug 2012

This is Nginx config for Ruby on Rails:

user deploy; worker_processes 2; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { passenger_root /usr/local/share/gems/gems/passenger-3.0.12; passenger_ruby /usr/bin/ruby1.9; include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name *.giveasia.org; location ^~ /assets { root /mnt/ebs/giviki2/current/public/; } location ^~ /uploads { root /mnt/ebs/giviki2/current/public/; } rails_env production; root /mnt/ebs/giviki2/current/public; passenger_enabled on; passenger_use_global_queue on; } server { listen 4747; server_name *.giveasia.org; location ^~ /uploads { root /mnt/ebs/giviki2/staging/current/public/; } rails_env staging; root /mnt/ebs/giviki2/staging/current/public; passenger_enabled on; passenger_use_global_queue on; } }

Give it a kudos