10
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ブラウザで長時間処理を行う際の設定(Nginx PHP-FPM)

Last updated at Posted at 2019-06-09

ブラウザで504が出る場合に確認する設定

XXXは数字

nginx.conf(リバースプロキシ)

proxy_connect_timeout XXX;
proxy_send_timeout XXX;
proxy_read_timeout XXX;

nginx.conf(PHP-FPM)

※locationの内側
fastcgi_send_timeout XXX;
fastcgi_read_timeout XXX;

keepaliveは再コネクションなので関係ないらしい

php-fpm.conf

※[global]の外側
request_terminate_timeoutの設定があれば無制限か伸ばす

request_terminate_timeout = XXX

php.ini

max_execution_timeの設定があれば無制限か伸ばす

max_execution_time = XXX

反映

systemctl restart php-fpm
systemctl restart nginx.service

その他

ELBのアイドルタイムアウトの設定 default 60s なので XXXに変更する必要がある。

10
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?