rtCamp / nginx-helper

Nginx Helper for WordPress caching, permalinks & efficient file handling in multisite
https://wordpress.org/plugins/nginx-helper/
224 stars 117 forks source link

Since upgrading to PHP 8, I'm getting a 502 Bad Gateway when trying to purge the entire cache #255

Closed jacklenox closed 1 year ago

jacklenox commented 3 years ago

I think this has coincided with me upgrading to PHP 8, but I now get a 502 Bad Gateway when I try to purge all content. I think the request is successful, but the response header seems to be causing issues. I've had a look at the NGINX logs and I'm seeing: upstream sent too big header while reading response header from upstream

This in general appears to relate to buffers being too small, but I'm seeing this error even with fastcgi_buffering off. Although I believe response headers are always buffered. So I've also tried upping my buffers to quite silly levels, but I still see the 502.

Let me know if I can provide any further details.

PDowney commented 1 year ago

I can confirm that this is happening on PHP 8.1 as well.

webdados commented 1 year ago

Same here, and I can confirm the log entry:

2022/12/14 16:14:28 [error] 29211#29211: *61245 upstream sent too big header while reading response header from upstream, client: 94.63.98.103, server: site.tld request: "GET /wp-admin/options-general.php?page=nginx&nginx_helper_action=purge&nginx_helper_urls=all&_wpnonce=97c33578a5 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php80-two-fpm.sock:", host: "www.site.tld", referrer: "https://www.site.tld/wp-admin/options-general.php?page=nginx"

rzvagelsky commented 1 year ago

Getting a 502 error here as well. Works fine to clear single page URL but on our multisite it goes straight to 502 for full purge from network on site purge from individual sites.

rzvagelsky commented 1 year ago

Problem solved for me...it was the Query Monitor plugin.

webdados commented 1 year ago

I've reached the Query Monitor developer and this is what I got: https://wordpress.org/support/topic/causes-nginx-helper-to-502-when-purging-cache/#post-16323119

gagan0123 commented 1 year ago

Closing the issue since that error has nothing to do with this plugin.