Reputation: 31
We have a file import Rails process that runs for a long time. Since switching to Nginx from Apache, we began getting 504 timeout errors after exactly 10 minutes each time -- we don't have a 10 minute limit set anywhere in our nginx.conf. I've looked at several questions/answers on stackoverflow but haven't found a solution. I don't want to go back to Apache since we love Nginx's simplicity and speed but this is driving me crazy since I've tried every timeout config option in Nginx that I could find :-)
This is currently what I have in our nginx.conf file -- what am I doing wrong?
http {
keepalive_timeout 300 300;
keepalive_requests 20;
send_timeout 30m;
proxy_read_timeout 30m;
proxy_connect_timeout 30m;
...
server {
listen 80;
...
server {
listen 443;
Upvotes: 2
Views: 1951
Reputation: 31
Turns out 10 minutes is a Nginx and Passenger hard-coded limit; got this email directly from the Passenger folks:
The 10 minute timeout is hardcoded into the Phusion Passenger module. But 10 minutes is actually already the maximum timeout that Nginx allows so there is no way to increase it.
Upvotes: 1
Reputation: 1688
You left out the important part of your config, but I assume you're probably doing a fastcgi_pass and not a proxy_pass. You'll want to look at these directives client_header_timeout, client_body_timeout and send_timeout.
Upvotes: 0