Want more timely Centmin Mod News Updates?
Become a Member

Nginx 502 Bad Gateway nginx error

Discussion in 'Install & Upgrades or Pre-Install Questions' started by virtualorbis, Sep 6, 2018.

  1. virtualorbis

    virtualorbis New Member

    Jul 11, 2018
    Local Time:
    8:38 PM
    Hello, I have started to receive this error message after importing a lot of records in my Wordpress database that filled the hard disk,
    hower I upgraded my VPS an I am still receiving the same error.

    Any suggestions to fix this issue?

    CentOS Version: i.e. CentOS 7 64bit
    Centmin Mod Version Installed: 123.09beta01
    Nginx Version Installed: i.e. 1.15.2
    PHP Version Installed: 7.2.8
    MariaDB MySQL Version Installed: 10.1.35-MariaDB
  2. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    11:38 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    what was size of wp database before and after import ? I'd take a read PHP-FPM - How to troubleshoot & optimize PHP-FPM server?

    Bad gateway 502 /504 timeouts are usually related to Nginx timing out waiting on PHP-FPM to respond as PHP-FPM is overloaded or overwhelmed with requests, so may need to tune PHP-FPM values. It also maybe due to PHP-FPM in turn being queued and backed up waiting on MariaDB MySQL server to respond - so also need to look at MySQL.

    You'll need to tune your PHP-FPM settings with php-fpm main pool config file at /usr/local/etc/php-fpm.conf (overview of config files) and this is left up to end user to do but here's a thread for starters to enable PHP-FPM status page output outlined at
    Enabling PHP-FPM status also allows setting up 3rd party PHP-FPM status metric monitoring from services like: