Support » Plugin: Query Monitor » 502 Bad Gateway nginx on Multisite

  • Hi John, first of all, thanks a lot for this plugin, an extremly helpful tool.

    I was facing a 502 error when updating stuff on the backend, “Save settings” on WP core, theme and plugins, and pinpointed it to Query Monitor. I couldn’t find any relevant error log… The save action is recorded to the DB, btw

    My wp-config is as follows:

    define('WP_AUTO_UPDATE_CORE', 'minor');
    define('DB_NAME', '***');
    define('DB_USER', '***');
    define('DB_PASSWORD', '***');
    define('DB_HOST', '***');
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');
    define('AUTH_KEY',         '***');
    define('SECURE_AUTH_KEY',  '***');
    define('LOGGED_IN_KEY',    '***');
    define('NONCE_KEY',        '***');
    define('AUTH_SALT',        '***');
    define('SECURE_AUTH_SALT', '***');
    define('LOGGED_IN_SALT',   '***');
    define('NONCE_SALT',       '***');
    define('JWT_AUTH_SECRET_KEY', '***');
    define('JWT_AUTH_CORS_ENABLE', true);
    define('WP_DEBUG', true);
    
    if ( WP_DEBUG ) {
        define( 'WP_DEBUG_LOG', false );
        define('WP_DEBUG_DISPLAY', false);
        $path = realpath( $_SERVER["DOCUMENT_ROOT"] . '/..' ) . '/debug.log';
        @ini_set( 'log_errors', 'On' ); 
        @ini_set( 'error_log', $path );
        error_reporting(0);
        @ini_set('display_errors', 0);
    }
    
    $table_prefix = '***';
    $_SERVER['HTTPS'] = "on";
    define('WP_HOME','https://site.com');
    define('WP_SITEURL','https://site.com');
    /** Define WordPress.com AKISMET API Key */
    define('WPCOM_API_KEY','***');
    define('FS_METHOD', 'direct');
    define('WPLANG', '');
    define('WP_MEMORY_LIMIT', '256M');
    # define('DISALLOW_FILE_EDIT', true);
    define('NOBLOGREDIRECT', 'https://site.com');
    define('DISABLE_WP_CRON', true);
    define('COOKIE_DOMAIN', false); 
    define('ADMIN_COOKIE_PATH', '/');
    define('COOKIEPATH', '');
    define('SITECOOKIEPATH', '') ; 
    # define( 'SUNRISE', 'on' );
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'site.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    And .htaccess:

    # BEGIN JWT PLUGIN
    RewriteEngine on
    RewriteCond %{HTTP:Authorization} ^(.*)
    RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
    # END JWT PLUGIN
    
    # WORDPRESS
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    Any suggestion on what I could do to further troubleshoot this?

    Thanks again!

Viewing 1 replies (of 1 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    I know it sounds a bit simple, but can you try clearing your cookies for the site, logging in, and trying again? A bad gateway can be caused by too large HTTP headers, which includes cookies. I’ve not seen this with QM but I’ve seen it with other plugins that use cookies and headers.

    Not sure what else to suggest at this point, I’ll have a think.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.