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'm running a django app with mod_wsgi and proxying with nginx. One of my views takes 2+ minutes to complete. When I visit it, I get a 504 gateway timeout. Is there a setting I can change to increase the time it takes to timeout? I've tried proxy_connect_timeout, proxy_read_timeout, and proxy_send_timeout in nginx without any luck.


share|improve this question
Well it should, can you show how did you configure your timeouts/server? – coredump May 7 '11 at 3:12

Have you checked this directive out?



It might not work since you have Apache as an intermediary between Nginx and your WSGI Application. You may be able to, like Sameer mentioned, increase the normal proxy timeout in Nginx and also find the equivelant configuration options in Apache for WSGI.

share|improve this answer

Modify the nginx configuration and increase the proxy_read_timeout value.

"This directive sets the read timeout for the response of the proxied server, in seconds by default. It determines how long nginx will wait to get the response to a request. The timeout is established not for entire response, but only between two operations of reading." --Nginx Documentation

share|improve this answer
as i mentioned in my question, i tried that already. i set it to 300 and it still timed out in less than a minute. – Kevin May 7 '11 at 3:39

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.