Error 504 (Gateway Timeout, time expired) occurs due to the fact that the nginx web server does not receive a response from the script within the specified time limit (the script execution timeout has exceeded). This may be due to the following reasons:
- Excessively lengthy operations (for example: unpacking archives, building a search index, etc.);
- The script involves responses from external sites that do not respond or take too long to respond;
- A circular request was created and did not complete due to a coding error or .htaccess file.