For Nginx Server
Make sure that you do not encounter exhaustion of workers on the PHP side, I also encountered this problem on my setup of the laboratory server, which was configured to save RAM. Basically, I forgot that you use one worker to process the main page displayed to the end user, then the get_file_contents () function basically generates a separate HTTP request to the same web server, effectively requiring two workers for the same page load. Since the first page used the last working one, the get_file_contents function was not available, so Nginx ended up responding with 504 on the first page because there was no response to the reverse proxy request.
source share