The 524 Gateway Timeout error typically occurs when a server takes too long to respond to a request from a client. This can happen for a number of reasons, including slow database queries, slow PHP code, or overloaded server resources.
Here are a few steps you can take to try and resolve the issue:
Increase the timeout limit in your server configuration: You can increase the timeout limit for your server by modifying the "timeout" parameter in your server's configuration file. In Plesk, this file is typically located at /etc/nginx/nginx.conf.
Check the PHP configuration: Make sure that the PHP configuration is optimized for your website. You can check the PHP configuration in Plesk by going to "Domains > example.com > PHP Settings".
Check your database: Slow database queries can cause the site to hang and lead to timeouts. You can optimize your database by running queries to delete unwanted data or optimize indexes.
Clear your Magento cache: Clear your Magento cache by deleting the files in the /var/cache/ folder. You can also try disabling the cache to see if that resolves the issue.
Check server resource usage: Check the resource usage on your server to ensure that the CPU and memory are not being overloaded. You can check this in Plesk by going to "Tools & Settings > Resources".
Check the server logs: Check the server logs for any error messages or warnings that might help you diagnose the issue. You can find the logs in Plesk by going to "Domains > example.com > Logs".