Skip to content

Instantly share code, notes, and snippets.

@sosedoff
Created February 8, 2011 21:39
Show Gist options
  • Save sosedoff/2b720b8b5384e529e191 to your computer and use it in GitHub Desktop.
Save sosedoff/2b720b8b5384e529e191 to your computer and use it in GitHub Desktop.
Sample nginx configuration
server {
listen 80;
server_name SERVER_NAME;
location / {
root /path/to/rails/app/public;
passenger_enabled on;
rails_env production;
if (-f $document_root/offline.txt) {
return 503;
}
}
location /maintenance.html {
root /path/to/rails/app/public;
}
error_page 503 /maintenance.html;
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|swf)$ {
root /path/to/rails/app/public;
expires max;
access_log off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment