Skip to content

Instantly share code, notes, and snippets.

@trevorturk
Created September 22, 2009 19:12
Show Gist options
  • Save trevorturk/191331 to your computer and use it in GitHub Desktop.
Save trevorturk/191331 to your computer and use it in GitHub Desktop.
daemon off;
worker_processes 6;
user nobody nobody;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
access_log /var/log/nginx_access.log;
error_log /var/log/nginx_error.log;
passenger_root /Library/Ruby/Gems/1.8/gems/passenger-2.2.5;
passenger_ruby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby;
passenger_max_pool_size 20;
passenger_max_instances_per_app 20;
passenger_pool_idle_time 3600;
# rails_app_spawner_idle_time 7200;
# rails_framework_spawner_idle_time 14400;
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 2;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.";
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
server {
listen 80;
server_name eldorado.local;
root /Users/trevorturk/Code/eldorado/public;
passenger_enabled on;
passenger_use_global_queue on;
rails_env development;
client_max_body_size 15M;
# serve static files without running more rewrite tests
if (-f $request_filename) {
break;
}
# redirect www to non-www
if ($host ~* www\.(.*)) {
set $host_without_www $1;
rewrite ^(.*)$ http://$host_without_www$1 permanent;
}
# disable site via capistrano (cap deploy:web:disable)
if (-f $document_root/system/maintenance.html) {
rewrite ^(.*)$ /system/maintenance.html break;
}
# expires headers
location ~* \.(ico|css|js|gif|jp?g|png)(\?[0-9]+)?$ {
expires max;
break;
}
}
server {
listen 80;
server_name static.local;
root /Users/trevorturk/Code/static/public;
passenger_enabled on;
rails_env development;
}
}
@plentz
Copy link

plentz commented Mar 24, 2011

This is your current config?

@trevorturk
Copy link
Author

I'm not actively using nginx at the moment, but it would have been something like this, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment