File_get_contents 504 gateway timeout after merging project with amazon EC2?

Checking the project and functionality, I realized that file_get_contents for internal files does not work at all. This always gives me the same error:

file_get_contents 504 gateway timeout

Can you help me figure out how to fix this?

+6
source share
1 answer

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.

+1
source

Source: https://habr.com/ru/post/985788/


All Articles