Unbreakable 90 sec timeout

Hello.

I’m spent half day to googling, reading documentation and try…

I have simple file to test what just sleep 120 second:

<?
sleep(120);
echo 'Done';
file_put_contents('test.date', date('c'));
?>

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

In try solve problem I set to big values many timeout directives:

        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;

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:

Hey what say your php.ini thay you use for the PHP?

Is there the problem?

Posted at Nginx Forum:

I think i found your Problem: you need to insert the timeout variables
into the location of your proxy request.

note: after the proxy include :wink:

Posted at Nginx Forum:

Indeed!
Thank you very much for the help. You are right - included
/etc/nginx/proxy.conf defines such timeout.

But if I want redefine its values afte inclusion I got error like:

[emerg]: "proxy_send_timeout" directive is duplicate in /etc/nginx/sites-enabled/detishop:18 configuration file /etc/nginx/nginx.conf test failed

Is there way have included common settings and just redefine some
for concrete location or server?

Posted at Nginx Forum:

Hubbitus,

It should work if you include the file in the server location and
override it in
your location.

Something like :
server {
include /etc/nginx/proxy.conf;
location / {
proxy_send_timeout 1600;
}
}

You got the idea, I guess.

Antoine.

----- Original Message ----