Hi,
I got "504 Gateway Time-out" when accessing admin/reports/updates/check on my local dev machine.
I suspect the problem is related with my slow internet connection. "updates/check" checks each module and theme for updates. I whant to give more time to nginx. Where I do that?
My configs are stock nginx 0.8.54 + php5-fpm (ubuntu desktop 10.10, I thing) with some changes I made for my environment and other changes are my trys to solve the 504.
/etc/nginx/sites-enabled/default:
server {
listen 82;
root /something/public_html/CMS;
index index.php ; #index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
allow 127.0.0.1;
deny all;
# this is what I try to avoid 504...
proxy_read_timeout 520;
proxy_connect_timeout 520;
resolver_timeout 500s;
# send_timeout 500;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
# try_files $uri $uri/ /index.html;
try_files $uri @drupalrewrite;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /something/public_html$fastcgi_script_name;
include fastcgi_params;
}
# tip: http://groups.drupal.org/node/39944#comment-113396
# needs some improvements to avoid my looong list of rewrites
location @drupalrewrite {
rewrite ^/d6-localdev$ /d6-localdev/ permanent;
rewrite ^/d6-localdev/(.*)$ /d6-localdev/index.php?q=$1 last;
# ... to many rewrites were to list ...
rewrite ^/(.)$ /index.php?q=$1 last;
}
}/etc/php5/fpm/pool.d/www.conf
things touched after 504 but without any result:
pm.start_servers = 20
listen.backlog = -1
request_slowlog_timeout = 10m
slowlog = /var/log/php-fpm.log.slow (EMPTY)tail /var/log/nginx/error.log
2011/02/11 12:54:00 [info] 19719#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:56
2011/02/11 12:54:13 [error] 19723#0: *6 open() "/geral/web/public_html/CMS/d6-localdev/sites/all/themes/newswire/screenshot.png" failed (13: Permission denied), client: 127.0.0.1, server: localhost, request: "GET /d6-localdev/sites/all/themes/newswire/screenshot.png HTTP/1.1", host: "localhost:82", referrer: "http://localhost:82/d6-localdev/admin/build/themes"
2011/02/11 12:55:06 [error] 19723#0: *3 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /d6-localdev/admin/reports/updates/check HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:82", referrer: "http://localhost:82/d6-localdev/admin/reports/updates"The "Permission denied" is solved with a chmod and I thing not related with 504. The "*3 upstream timed out (110: Connection timed out)" is the part I dont know own investigate further.
To get 504 after refresh page requires 60 seconds. I just check on configs to see any 60s or 1m config timeout or something.
What are your suggestions?
thanks
Comments
Try fastcgi_read_timeout
Try fastcgi_read_timeout and fastcgi_send_timeout instead of proxy_read_timeout.
Thanks Solved with
Thanks
Solved with fastcgi_read_timeout and fastcgi_send_timeout !
Your config is insecure
The PHP block is too generic. Remember that you can have a PHP dressed as a JPEG. You just have to set the "correct" file header. See this issue: http://drupal.org/node/65409
Now you don't have Drupal holding your hand for preventing unauthorized PHP execution. The
.htaccessin the files directory is useless with Nginx.yes, i know that. however,
yes, i know that. however, this is temp local dev env that will be tunned or maybe the configs will be replaced by other (almost) bullet proof solutions out there ;)