Welcome to Centmin Mod Community
Become a Member

Xenforo nginx 504 gateway timeout

Discussion in 'Forum software usage' started by Andy, Oct 25, 2017.

  1. Andy

    Andy Active Member

    331
    47
    28
    Aug 6, 2014
    Ratings:
    +56
    Local Time:
    3:04 PM
    Been using centminmod on my main site for a while without issue and now, everytime I log in Xenforo ACP, it shows that there is a process that not done running so I let it run but it will end up 504 gateway timeout all the time. This is what I get in the error log

    Code:
    2017/10/24 16:55:10 [error] 12923#12923: *79646 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xx.xx.xxx, server: www.mysite.com, request: "POST /admin.php?tools/run-deferred HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.mysite.com", referrer: "https://www.mysite.com/admin.php?tools/run-deferred"
    
    Where I begin to debug @eva2000 ? My thought would be to increase fastcgi timeout.
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,630
    6,862
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,307
    Local Time:
    6:04 AM
    Nginx 1.13.x
    MariaDB 5.5
    how long does it go before timing out ? that would give an idea of how much you need to raise the timeouts for and what xenforo process/rebuild is it related to ?

    php.conf include file in vhost at /usr/local/nginx/conf/php.conf is where fastcgi_* _timeouts are located. You can make a copy of /usr/local/nginx/conf/php.conf for admin.php specific locations with higher timeouts just for admin related requests too

    i.e. from Nginx Rewrites for Xenforo Friendly Urls - CentminMod.com LEMP Nginx web stack for CentOS

    admin.php location might be
    Code (Text):
           location /admin.php {
                auth_basic "Private";
                auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
                   include /usr/local/nginx/conf/php.conf;
                   allow 127.0.0.1;
                   allow YOURIPADDRESS;
                   deny all;
           }
    

    change to below after making copy of /usr/local/nginx/conf/php.conf as /usr/local/nginx/conf/php_xfadmin.conf
    Code (Text):
    cp -a /usr/local/nginx/conf/php.conf /usr/local/nginx/conf/php_xfadmin.conf
    

    Code (Text):
           location /admin.php {
                auth_basic "Private";
                auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
                   include /usr/local/nginx/conf/php_xfadmin.conf;
                   allow 127.0.0.1;
                   allow YOURIPADDRESS;
                   deny all;
           }