Why is Craft returning a 504 during a system update?
I've had this issue before.

It's usually to do with one of two things for me - either the PHP script timeout value or the FPM proxy timeout value.

Another method of fixing this is to change the update settings in the general Craft configuration:

'backupDbOnUpdate' =&gt; false,


Keep in mind though that you will need to back up the database yourself.