Commit 778bd3d7

mo k <mo@mokhan.ca>
2012-11-13 14:17:48
optimize the nginx configuration.
1 parent 41e4e27
Changed files (1)
config/nginx.conf
@@ -11,12 +11,21 @@ http {
   include       mime.types;
   default_type  application/octet-stream;
 
+  client_body_buffer_size 8K;
+  client_header_buffer_size 1k;
   client_max_body_size 4M;
+  large_client_header_buffers 2 1k;
+
   sendfile        on;
-  keepalive_timeout  65;
+
+  client_body_timeout 10;
+  client_header_timeout 10;
+  keepalive_timeout  15;
+  send_timeout 10;
 
   gzip             on;
-  gzip_min_length  500;
+  gzip_comp_level  2;
+  gzip_min_length  1000;
   gzip_proxied     expired no-cache no-store private auth;
   gzip_types       text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
   gzip_disable     "MSIE [1-6]\.";
@@ -42,7 +51,15 @@ http {
     passenger_enabled on;
     rails_env    staging;
     error_log /var/log/nginx/cakeside.error.log;
-    access_log /var/log/nginx/cakeside.access.log;
+    access_log off;
+    location ~* "\.(js|ico|gif|jpg|png|css|html|htm|swf|htc|xml|bmp|cur)$" {
+      root          /home/cakeside/apps/www.cakeside.com/current/public;
+      add_header    Pragma "public";
+      add_headerr   Cache-Control "public";
+      expires       3M;
+      access_log    off;
+      logg_not_found  off;
+    }
     location ~ ^/assets/ {
       expires 1y;
       add_header Cache-Control public;