Join the community today
Register Now

Nginx 502 bad gateway errors

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Mar 2, 2016.

  1. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    10:38 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hi

    I am getting a lot of 502 bad gateway errors and this error i think is related to phpfpm (i am using multiple pools) and don't know why as on the same specs server i have another site running x4 more traffic with an older version of centminmod and with exact same settings and i am wondering if it is any bug related to latest centminmod beta as on a third server with exact same setup/settings and almost no traffic at all i have the same issue and in the logs of phpfpm there is no info there and limit problems for max children or anything related.

    In the last month i was install 3 servers and all have the same issue but on all older servers never had this issue without a reason....

    For me it looks like the problem starts when you add the maintenance mode but i am not sure and don't have more accurate info :(

    If it is auto detecting the fpm if it is down or not the problem could be that i use fpm pools?

    Or maybe some php code is not compatible with the 5.6.x php..... Can't think anything else...

    Thanks :)
     
    Last edited: Mar 2, 2016
  2. eva2000

    eva2000 Administrator Staff Member

    30,165
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    5:38 AM
    Nginx 1.13.x
    MariaDB 5.5
    see also Centminmod beta latest version 404 issue and fix for it | Centmin Mod Community but if you disable maintenance mode, does 502 errors specifically go away ?

    Old servers using exact same PHP version ?

    Try an install with multiple php-fpm pools disabled and see what happens

    Also check your error logs for clues
     
  3. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    10:38 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    No :(

    Yes

    Which file can give info for 502 errors?
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,165
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    5:38 AM
    Nginx 1.13.x
    MariaDB 5.5
    nginx 502 is in nginx logs but it's just saying can't connect to php-fpm server because it's down so php-fpm error log too
     
  5. pamamolf

    pamamolf Well-Known Member

    2,723
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    10:38 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Is that enough to test it? :

    Code:
    ;include=/usr/local/nginx/conf/phpfpmd/*.conf
    restart fpm.....

    or i must revert everything step by step?
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,165
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    5:38 AM
    Nginx 1.13.x
    MariaDB 5.5