Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 problem with my production nginx configuration (on my development machine with mongrel everything works). My environment is: nginx as proxy, rainbows as backend running rails 3.1 application with ruby 1.9.2.

When I'm trying to upload large file (more than 1MB) I see 502 error on my website and in nginx error log file:

2012/04/02 14:45:17 [error] 14415#0: *658 sendfile() failed (32: Broken pipe) while sending request to upstream, ....

What I've tried:

  • setting client_max_body_size 5m;
  • keepalive_timeout 600;

Uploading smaller files works fine. What could be the problem?

share|improve this question
up vote 0 down vote accepted

After some time I've found that you have to repeat max file upload size setting in rainbows configuration file:

client_max_body_size(2 * 1024 * 1024)
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.