proxy_read_timeout is not fastcgi_read_timeout

A slow endpoint returning a 504 through nginx has three different timeouts that could be responsible, and they are configured by different directives.

# for proxy_pass — an upstream over HTTP
proxy_read_timeout    60s;
proxy_connect_timeout 5s;

# for fastcgi_pass — php-fpm over a socket
fastcgi_read_timeout  60s;

# and the one inside PHP, which is separate again
#   max_execution_time = 30
#   → PHP kills the script first, and nginx returns 502,
#     not 504, because the connection closed

The distinction between a 502 and a 504 is the quickest diagnostic: a 504 is nginx giving up on a backend that is still working, and a 502 is the backend closing the connection first, which usually means PHP hit max_execution_time. Setting the nginx timeout longer than PHP’s is the arrangement that makes the error informative, because then the message in the PHP log names the script. Raising all three because a report is slow is treating a symptom, and the report is the next note in somebody’s backlog.