# taken mostly from "The Rails Way" page 663 # user and group to run as user <%= nginx_user %>; # number of nginx workers worker_processes <%= nginx_processes %>; # pid of nginx master process pid /var/run/nginx.pid; error_log /var/log/nginx/default.error.log debug; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; # number of worker connections. 1024 is a good default events { worker_connections 1024; use epoll; # linux only! } http { # pull in mime-types. You can break out your config # into as many include's as you want. include /etc/nginx/mime.types; # set a default type for the rare situation that nothing matches. default_type application/octet-stream; # configure log format log_format main '$remote_addr - $remote_user [$time_local] $request ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; # no sendfile on OS X sendfile on; tcp_nopush on; tcp_nodelay on; #keepalive_timeout 0; keepalive_timeout 65; <% if nginx_gzip_on %> gzip on; gzip_http_version 1.0; gzip_comp_level 2; gzip_proxied any; <% if nginx_gzip_xml_on %> # IE 6 doesn't pass compressed xml to flash. So if no flash xml consumption on site can add # text/xml application/xml application/xml+rss <% end %> gzip_types text/plain text/html text/css application/x-javascript text/javascript; <% end %> access_log /var/log/nginx/nginx.default.access.log main; error_log /var/log/nginx/nginx.default.error.log info; include /etc/nginx/vhosts/*.conf; }