Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a ruby app which runs under passenger and nginx. If i try to upload a largish file (eg 15+ meg), when it gets to 30s in, the upload restarts (according to chrome) and at the end of the next 30 seconds it gives up and i get a timeout.

Is there an option i can put in my nginx config to prevent this from happening? Here's what my current nginx config looks like:

worker_processes  1;

events {
    worker_connections  1024;

http {
    passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2;
    passenger_ruby /usr/local/bin/ruby;

    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    gzip  on;
    gzip_min_length  1000;
    gzip_proxied     expired no-cache no-store private auth;
    gzip_types       text/plain application/xml text/css text/javascript application/x-javascript;
    gzip_disable     "MSIE [1-6]\.";

 server {
      listen 80;
      root /var/www/apps/akrotoski/public;   # <--- be sure to point to 'public'!
      passenger_enabled on;

I'm not an nginx expert and have a feeling this might be obvious, hope so anyway. I already tried adding

proxy_read_timeout: 600; 

to the server block but that didn't help.

Cheers, max

share|improve this question
Please post a log snippet? – quanta Nov 8 '11 at 0:00

I just ran into this issue and seemed to have fix it by upping the client_max_body_size in my server's http block:

http {
    client_max_body_size 128m;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.