tillkruss / Nginx-FastCGI-Cache

A WordPress plugin that purges Nginx cache zones.
48 stars 25 forks source link

502 Bad Gateway Error #16

Closed miklb closed 6 years ago

miklb commented 6 years ago

I'm seeing this error PHP Warning: Invalid argument supplied for foreach() in //plugins/Nginx-FastCGI-Cache/nginx-cache.php on line 198

And getting a 502 bad gateway error along with upstream sent too big header while reading response

This is my conf for fastcgi which I thought was related

        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        fastcgi_cache_valid 60m;
        proxy_buffer_size   128k;
        proxy_buffers   4 256k;
        proxy_busy_buffers_size   256k;

Any suggestions greatly appreciated.

tillkruss commented 6 years ago

I've fixed that in https://github.com/tillkruss/Nginx-FastCGI-Cache/commit/7e5d67048c2e25aac58212afb28259e2ba103929.

Could you download the master version of this plugin and see if that worked?

miklb commented 6 years ago

Looks like the error moved to 207. Also, looking through query-monitor, looks like I've still not sorted out the correct permissions for my /cache directory which might be related? I'm not getting an error with the plugin for File Permissions API however.

tillkruss commented 6 years ago

Same error? Can you try master: https://github.com/tillkruss/Nginx-FastCGI-Cache/archive/master.zip

tillkruss commented 6 years ago

Directory permissions might be related, but I'd like the plugin to tell you that without crashing.

miklb commented 6 years ago

I'm checking out at CLI from this repo's master branch. I'm game to help debug as much as I can.

tillkruss commented 6 years ago

Could you post the PHP error?

miklb commented 6 years ago

Invalid argument supplied for foreach() content/plugins/Nginx-FastCGI-Cache/nginx-cache.php:207

tillkruss commented 6 years ago

var_dump($list); exit; in line 206 please?

miklb commented 6 years ago

Sorry, GitHub choked on the copy/paste so adding as a file var_dump.txt

tillkruss commented 6 years ago

That should work. Maybe it's being called several times.

Maybe just try fixing the permissions for your Nginx cache path.

miklb commented 6 years ago

I just cleaned up 2 more directory permissions inside my cache and now not getting the error. I'll keep an eye out, still not seeing the Filesystem error I was getting before. Either way, thanks for the quick response and your work on this plugin.