504 means your web server asked another server (database, cdn, etc) for information it needed and didn’t get it back in time. I’d look in your nginx error log files for the actual error as it’s reported, I suspect you’ll find out which thing isn’t being speedy enough.
Hi Topher, Thanks for the reply.
Below is the common error I saw in nginx error log.
2022/01/07 08:04:35 [error] 1221#1221: *528105 open() "/var/www/html/wordpress/wp-content/uploads/2021/09/logo@2x.png" failed (2: No such file or directory), client: 10.0.0.179, server: xxxxxx, request: "HEAD /wp-content/uploads/2021/09/logo@2x.png HTTP/1.1", host: "xxxxxxx", referrer: "xxxxxxxx"
2022/01/07 08:04:34 [error] 1219#1219: *527727 open() "/var/www/html/wordpress/wp-content/uploads/elementor/thumbs/white-logo-pdvjpn06yq1s6gwnx9yk13fox10gqrf684mjseljke@2x.png" failed (2: No such file or directory), client: 10.0.0.179, server: xxxxxxx, request: "HEAD /wp-content/uploads/elementor/thumbs/white-logo-pdvjpn06yq1s6gwnx9yk13fox10gqrf684mjseljke@2x.png HTTP/1.1", host: "xxxxxx", referrer: "xxxxxxxxx/?answer-1=b)%20%E0%A4%AE%E0%A4%B9%E0%A4%BF%E0%A4%B2%E0%A4%BE%20%E0%A4%AA%E0%A4%A4%E0%A5%8D%E0%A4%B0&answer-2=b)%2030%&answer-3=a)%201%20%E0%A4%B2%E0%A4%BE%E0%A4%96&answer-4=b)%20%E0%A4%B8%E0%A5%8D%E0%A4%95%E0%A5%82%E0%A4%9F%E0%A5%80&answer-5=b)%207,000"
I am not sure why this file or folder is missing. There are lots of failed requests for this URL when the site went down.