Unbreakable 90 sec timeout

Hubbitus nginx-forum at nginx.us
Sat Feb 5 01:11:16 MSK 2011


Hello.

I'm spent half day to googling, reading documentation and try...

I have simple file to test what just sleep 120 second:
[code]
<?
sleep(120);
echo 'Done';
file_put_contents('test.date', date('c'));
?>
[/code]

But nginx (binary Debian package) always fired error 504: [code]
504 Gateway Time-out
nginx/0.6.32
[/code]
after 90 seconds timeout.

In try solve problem I set to big values many timeout directives:
[code]
        proxy_connect_timeout 600;
        proxy_send_timeout 600;
        proxy_read_timeout 600;
        fastcgi_read_timeout 600;
        client_body_timeout 600;
        client_header_timeout 600;
        send_timeout 600;
        fastcgi_connect_timeout 600;
        fastcgi_send_timeout 600;
[/code]
but unfortunately it does not helps.

Full config used:
[code]server {
    listen 11.22.33.44:80;
    server_name example.com www.example.com;

        proxy_connect_timeout 1600;
        proxy_send_timeout 1600;
        proxy_read_timeout 1600;

        fastcgi_read_timeout 1600;
        client_body_timeout 1600;
        client_header_timeout 1600;
        send_timeout 1600;

        fastcgi_connect_timeout 1600;
        fastcgi_send_timeout 1600;

    access_log /var/www/site/logs/nginx_access.log;
    error_log /var/www/site/logs/nginx_error.log;

    location / {
        proxy_pass http://127.0.0.1:8080;
        include /etc/nginx/proxy.conf;
        proxy_temp_path /var/nginx/proxy_temp;
        root /var/www/site/www/;
    }

    location ~*
^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf|flv|html|htm|mp3)$
{
        root /var/www/site/www/;
        access_log off;
        expires 30d;
    }
}
[/code]

What is also may be interesting - if directly ask Apache which act there
as frontend - script work. Even via nginx script also run to end - date
in file updated each time despite 504 error produced for user.

What more can I tune?

With best wishes, Pavel Alexeev.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,172262,172262#msg-172262




More information about the nginx mailing list