# # Nginx conf # # See vhost conf for site specific stuff. # # ==== References: # http://brainspl.at/articles/2006/08/23/nginx-my-new-favorite-front-end-for-mongrel-cluster # http://brainspl.at/articles/2007/01/03/new-nginx-conf-with-optimizations # http://topfunky.net/svn/shovel/nginx # http://robsanheim.com/2008/02/07/beware-the-default-nginx-config-old-ie6-hates-gzip/ # # Nginx + memcached: # http://www.igvita.com/2008/02/11/nginx-and-memcached-a-400-boost/ # http://blog.kovyrin.net/2007/08/05/using-nginx-ssi-and-memcache-to-make-your-web-applications-faster/ # # Fair balancing: # http://brainspl.at/articles/2007/11/09/a-fair-proxy-balancer-for-nginx-and-mongrel # user and group to run as user nginx nginx; # number of nginx workers worker_processes 6; # pid of nginx master process pid <%= nginx_pid_path %>; events { worker_connections 1024; } http { include <%= File.dirname(nginx_conf_path) %>/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] $request ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; # main access log access_log /var/log/nginx_access.log main; # main error log error_log /var/log/nginx_error.log debug; # no sendfile on OSX sendfile on; #keepalive_timeout 0; keepalive_timeout 65; # These are good default values. tcp_nopush on; tcp_nodelay off; # output compression saves bandwidth gzip on; gzip_http_version 1.0; gzip_comp_level 2; gzip_proxied any; gzip_buffers 16 8k; gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; # GZip fails on pre SP2 IE6 browsers (even though is says it can) # Thanks, http://robsanheim.com/2008/02/07/beware-the-default-nginx-config-old-ie6-hates-gzip/ # TODO: This doesn't work with our version of nginx #gzip_disable "MSIE [1-6]\.(?!.*SV1)"; #gzip_disable "MSIE [1-6]\."; # Auto include include /etc/nginx/vhosts/*.conf; # HTTPS server # #server { # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }