nginx timeout

  • fastcgi_○○は、nginxとphpでのやりとりの時間。はじめにconnectしてからリクエストをsend、応答を待つ時間がreadなので、php側で重い処理をする場合などはfastcgi_read_timeoutのみ設定すればいける。
  • proxy_○○は、nginxをプロキシサーバとして使っている場合に設定。
  • send_timeoutは、サーバとクライアント間でのタイムアウト時間。
  • keepalive_timeoutは、接続をキープする時間。

nginx + php で504 Gateway Timeout(タイムアウト)設定あれこれ 2021

FastCGI php-fpm

https://server-setting.info/centos/nginx-upstream-timed-out.html

504 Gateway Timeout

php.ini
max_execution_time = 180

php-fpm.conf
request_terminate_timeout 180

nginx.conf
fastcgi_read_timeout 180

Nginx+PHP-FPMでタイムアウトを伸ばす | クロジカ 2014

デフォルト 60s

Syntax:	fastcgi_read_timeout time;
Default:	fastcgi_read_timeout 60s;
Context:	http, server, location

https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html