Nginx and php-fpm 504 Gateway Time-out troubleshooting and Solutions
Many people may have encountered 504 Gateway Time-out. Sometimes it is confusing.
Solution:
1. Baidu allows many people to say that you can adjust the nginx configuration or php-fpm configuration, and you can configure Baidu. However, many of them have tried nothing soft to use.
2. try the above method or return to the essence of whether the whole site is 504. if not, I suggest you open the php-fpm slow log to check which method or operation causes the corresponding page request and response slow.
The configuration of php-fpm slow log is as follows:
Request_slowlog_timeout = 5 // more than 5 seconds. When a request times out, the corresponding PHP call stack information will be completely written to the slow log and set to '0' to 'off'
Slowlog =/var/log/php-fpm.slow.log // log directory
Open the LOG method to check which method or operation causes the problem. Directly modify the code.
Php-fpm slow logs are not recommended in the production environment.