How to Fix 504 Timeout Issue in Magento with Apache, PHP-FPM, and Varnish? (Edited)
I have a Magento website, and when I run a backend process in the admin panel that “might take a long time,” I get a 504 timeout error.
I increased PHP’s max_execution_time to 1500 seconds, but the request still gets interrupted after 60 seconds. The Cloudflare proxy is disabled, but this does not solve the problem. The server is hosted on a VPS. I checked the PHP-FPM and Apache logs but found nothing related to the 504 error.
Answers
Robert Brown
15 days ago
Rating
Cloudflare has a timeout limit of 100 seconds that cannot be changed. Since your connection breaks after 60 seconds, the issue likely isn’t with Cloudflare. If you've already checked the logs and set the correct timeout parameters in Apache, Varnish, and PHP-FPM, you might want to check your cloud provider's configuration. It’s possible that HAProxy or another load balancer is being used, which might have its own timeout settings that need to be adjusted to increase the waiting time.