public
Created

Nginx config with Unicorn and Rails 3.1

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
upstream example {
server unix:/home/example/shared/example.sock fail_timeout=0;
}
 
server {
listen 80;
server_name example.com;
 
client_max_body_size 100M;
 
root /home/example/current/public;
 
access_log /home/example/shared/log/access.log main;
error_log /home/example/shared/log/error.log info;
 
 
# This is a ruby application, deny other common types.
location ~ \.(php|asp|aspx|jsp|cfm|dll)$ {
deny all;
break;
}
 
location / {
include /etc/nginx/conf/proxy.conf;
if (!-f $request_filename) {
proxy_pass http://example;
break;
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.