title: nginx upload client_max_body_size issue
body: <p>I'm running nginx/ruby-on-rails and I have a simple multipart form to upload files.
  Everything works fine until I decide to restrict the maximum size of files I want uploaded. 
  To do that, I set the nginx <em><code>client_max_body_size</code></em> to <em>1m</em> (1MB) and expect a HTTP 413 (Request Entity Too Large) status in response when that rule breaks.</p>
  
  <p><strong>The problem</strong> is that when I upload a 1.2 MB file, instead of displaying the HTTP 413 error page, the browser hangs a bit and then dies with a "Connection was reset while the page was loading" message.</p>
  
  <p>I've tried just about every option there is that nginx offers, nothing seems to work. Does anyone have any ideas about this?</p>
  
  <p>Here's my nginx.conf:</p>
  
  <pre><code>worker_processes  1;
  timer_resolution  1000ms;
  events {
      worker_connections  1024;
  }
  
  http {
      passenger_root /the_passenger_root;
      passenger_ruby /the_ruby;
  
      include       mime.types;
      default_type  application/octet-stream;
  
      sendfile           on;
      keepalive_timeout  65;
  
      server {
        listen 80;
        server_name www.x.com;
        client_max_body_size 1M;
        passenger_use_global_queue on;
        root /the_root;
        passenger_enabled on;
  
        error_page 404 /404.html;
        error_page 413 /413.html;    
      }    
  }
  </code></pre>
  
  <p><strong>Thanks.</strong></p>
  
  <hr>
  
  <p><strong><code>**Edit**</code></strong></p>
  
  <p>Environment/UA: Windows XP/Firefox 3.6.13</p>