Nginx and php-fpm 504 Gateway Time-out troubleshooting and Solutions

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.