Hello,
At first glance, your issue does not seem to be related to WordPress specifically, but rather to your Nginx/PHP configuration. A 504 Gateway Timeout error when trying to access PHP files suggests a communication issue between Nginx and PHP-FPM.
You can try creating a basic test file (e.g., test.php) using SSH.
<?php echo "Hello!"; ?>
or
<?php phpinfo(); ?>
If the test file doesn’t execute as expected, you should check the status of your PHP-FPM service:
systemctl status php-fpm
Consider consulting the logs of Nginx & php-fpm found in /var/logs/.
Regards,