Skip to content

Instantly share code, notes, and snippets.

@tibra
Created January 10, 2012 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tibra/1589113 to your computer and use it in GitHub Desktop.
Save tibra/1589113 to your computer and use it in GitHub Desktop.
Nginx config with Unicorn and Rails 3.1
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;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment