Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the torden branch of ngx_cache_purge #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gnif
Copy link

@gnif gnif commented Jun 13, 2023

The torden branch has support for purge_all with the following directive added to the nginx configuration:

location = /purgeall {
	fastcgi_pass		unix:/dev/null;
	fastcgi_cache		WORDPRESS;
	fastcgi_cache_purge	PURGE purge_all from 127.0.0.1;
}

This makes it possible to purge the cache on systems where Nginx is running as a different user to the PHP process.

Note, the unix:/dev/null in the above example is not a placeholder, the module needs fastcgi_pass set to something valid or it will not function, even though it never uses the value provided.

2023-06-13-104906_544x272_scrot

The torden branch has support for `purge_all` with the following
directive added to the nginx configuration:

```
location = /purgeall {
	fastcgi_pass		unix:/dev/null;
	fastcgi_cache		WORDPRESS;
	fastcgi_cache_purge	PURGE purge_all from 127.0.0.1;
}
```

This makes it possible to purge the cache on systems where Nginx is
running as a different user to the PHP process.

Note, the `unix:/dev/null` in the above example is not a placeholder,
the module needs `fastcgi_pass` set to something valid or it will not
function, even though it never uses the value provided.
@gridpane
Copy link

We are using this module, and have a helper mu plugin installed with much the same code... this really would be great the core plugin

@gridpane
Copy link

Ive pulled this into my fork, alongside working on sockets and some other things, ive adjusted this to run a php check for php5.5+ since one of the curl functions requires that, but nginx helper is set for 5.4+

Seems this fork is taking code to I wrote with Jebat 5 years ago and bringing it into nginx helper

https://github.com/JeffCleverley/NginxFastCGICachePurger

@gridpane
Copy link

gridpane commented Jun 29, 2024

I have pulled in code from this, combined it with other work we have been doing on Redis sockets, db, and ACLs, and setting everything to be configurable by constants:

https://github.com/gridpane/nginx-helper

I plan to make a PR back here once finished testing, ive accredited gnif in readme etc, but also added guards for php version and fixed all the conflicts.

Was working on the redis connections and saw this waiting with conflicts, figured since we use this code anyway made sense to try to get it all done.

Screenshot 2024-06-29 at 22 26 31 Screenshot 2024-06-29 at 22 27 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants