Nginx and php-fpm 504 Gateway Time-out troubleshooting and case resolution

Many people may have encountered 504 Gateway Time-out. Sometimes it can be confusing.
Solution:
1. According to Baidu, you can adjust nginx configuration or php-fpm configuration. Everyone can configure Baidu, so I won't say much here. But many have tried to no avail.
2. After trying the above method, I still return to whether the entire site is essentially 504. If not, I suggest you open the php-fpm slow log to see which method or operation caused the slow response and request of the corresponding page.
The configuration of the php-fpm slow log is as follows:
request_slowlog_timeout = 5 //When a timeout of more than 5 seconds is requested, the corresponding PHP call stack information will be completely written to the slow log. Set to '0' to indicate 'Off'
slowlog = /var/log/php-fpm.slow.log //Log directory

Then open the log method to see which method or operation caused it. Modify the code directly.
php-fpm slow log is not recommended to be used in a production environment.

For more problem solutions, please search Qianfeng PHP, Qianfeng Forum, search for more problem solutions

Guess you like

Origin blog.csdn.net/chengshaolei2012/article/details/72668509
Recommended