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 a Rails+Phusion Passenger set-up. Sometimes, the user query that Nginx is proxying to Passenger/Rails times out. How can we set Nginx such that after keepalive_timeout, Nginx does NOT retry but rather just reports the error - likely a 502 - and just keep going on rather than re-trying the 'bad' controller/action again and again

share|improve this question
  proxy_read_timeout 600;
      proxy_next_upstream off;

Increase the timeout and turn off the upstream retry

The stops the resubmit after 60 seconds but we still find a resubmit after 305 seconds. Don't know why, so we have done this: proxy_read_timeout 600;

To timeout after 5 min and user gets a 504

share|improve this answer

Your Answer


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