504 Gateway Timeout Checklist for Nginx WordPress

halfbrain_logo512adminJune 12, 2026
11 lượt xem

504 Gateway Timeout Checklist for Nginx WordPress

A 504 Gateway Timeout usually means Nginx waited too long for the backend to respond. On a WordPress VPS, the backend is often PHP-FPM, MySQL or a slow WordPress process.

Common causes

  • PHP-FPM is overloaded or stopped.
  • MySQL is slow or unavailable.
  • VPS RAM or CPU is exhausted.
  • A plugin creates slow requests.
  • Bot traffic overloads the website.
  • Nginx or PHP timeout values are too low for the workload.

Checklist

  1. Check if the whole website is down or only one URL.
  2. Test Nginx configuration.
  3. Check Nginx service status.
  4. Check PHP-FPM status.
  5. Check MySQL or MariaDB status.
  6. Check RAM, CPU and disk usage.
  7. Read Nginx error log.
  8. Read access log for bot spikes.
  9. Review recent WordPress plugin changes.
  10. Restart services only after checking the logs.
  11. Monitor the site after recovery.

Final check

Do not treat restart as the full solution. Restart can bring the website back temporarily, but the real fix comes from identifying the bottleneck in logs and server resources.

Estimated Time

30–90 minutes

Use Case

Use this checklist when a WordPress site behind Nginx returns 504 Gateway Timeout.


Common Mistakes

  • Restarting everything without reading logs.
  • Increasing timeout without fixing slow backend.
  • Ignoring bot traffic.
  • Forgetting to check disk usage.
  • Blaming Nginx when MySQL is the real bottleneck.

Related Commands

sudo nginx -t
sudo systemctl status nginx
sudo systemctl status php8.2-fpm
sudo systemctl status mysql
free -h
df -h
top
sudo tail -n 100 /var/log/nginx/error.log
sudo tail -n 100 /var/log/nginx/access.log
See also  WordPress Backup Checklist for VPS Websites

Share:

Disclaimer: The guides, checklists, commands, and examples on HalfBrain.net are provided for educational and operational reference only. Server environments, hosting providers, software versions, security settings, and WordPress configurations can vary, so you should always review commands before running them on your own system. We do our best to keep the content accurate and useful, but we cannot guarantee that every command, configuration, or recommendation will fit every environment. Always back up your website, database, and server configuration before making changes. HalfBrain.net is not responsible for data loss, downtime, security incidents, misconfiguration, or other issues that may result from applying the information on this website. Use the material at your own discretion.

Leave a Reply

Your email address will not be published. Required fields are marked *