504 Gateway Timeout
504 means a gateway or proxy did not get a response from the upstream (the server behind it) in time. Here Nginx waited 60 seconds and then gave up.
"502 Bad Gateway" is wrong because 502 means the upstream sent an invalid response. Examples are a refused connection or a crashed process. "503 Service Unavailable" is wrong because 503 means the server is overloaded or down for maintenance.
Read more