You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> This plugin allows WordPress users to manage Nginx Cache Purge and Preload operations directly from the WordPress admin dashboard, enhancing website performance and caching efficiency.
10
+
> NPP allows WordPress users to manage Nginx Cache operations directly from the WordPress admin dashboard, enhancing website performance and caching efficiency. NPP supports Nginx **FastCGI**, **Proxy**, **SCGI**, and **UWSGI** cache purge and preload operations, making it the most comprehensive solution for managing Nginx Cache from your WordPress dashboard.
11
11
12
12
### Requirements
13
13
14
-
This wordpress plugin is compatible exclusively with **Nginx web servers** running on **Linux-powered** systems. Additionally, the **shell_exec** function must be enabled and unrestricted. Consequently, the plugin may not operate fully on shared hosting environments where native Linux commands are blocked from running via PHP.
14
+
NPP is compatible exclusively with **Nginx web servers** running on **Linux-powered** systems. Additionally, the **shell_exec** function must be enabled and unrestricted. Consequently, the plugin may not operate fully on shared hosting environments where native Linux commands are blocked from running via PHP.
15
15
16
16
Moreover, granting the correct permissions to the PHP process owner (PHP-FPM-USER) is essential for the proper functioning of the purge and preload operations. This is necessary in isolated user environments that have two distinct user roles: the WEBSERVER-USER (nginx or www-data) and the PHP-FPM-USER.
17
17
@@ -33,7 +33,7 @@ Moreover, granting the correct permissions to the PHP process owner (PHP-FPM-USE
33
33
🚀**Remote Nginx Cache Purge & Preload via REST API**: Remotely trigger cache purging and preloading through `REST API` endpoints.<br/>
34
34
🚀**Manual Nginx Cache Purge & Preload**: Allow manual purging and preloading of cache through the table view in Advanced Tab.<br/>
35
35
🚀**On-Page Nginx Cache Purge & Preload**: Manually purge and preload Nginx cache for the currently visited page directly from the frontend.<br/>
36
-
🚀**Custom Cache Key Support**: Define a regex pattern to parse URLs based on your custom `fastcgi_cache_key` format.<br/>
36
+
🚀**Custom Cache Key Support**: Define a regex pattern to parse URLs based on your custom `(fastcgi|proxy|uwsgi|scgi)_cache_key` format.<br/>
37
37
🚀**Optimized Nginx Cache Preload**: Enhance Nginx cache preload performance with options to limit server resource usage, via exclude endpoints, exclude file extensions, wait retrievals and rate limiting.<br/>
38
38
🚀**Monitor Plugin and Nginx Cache Status**: Monitor plugin status, cache status, cache preload status, and Nginx status from the Status tab.<br/>
39
39
🚀**User-Friendly Interface**: Easy-to-use AJAX-powered settings, integrated into the WordPress admin bar for quick access.<br/>
@@ -44,7 +44,9 @@ Moreover, granting the correct permissions to the PHP process owner (PHP-FPM-USE
44
44
45
45
### Overview
46
46
47
-
This project addresses the challenge of automating Nginx FastCGI cache purging and preloading (WordPress) in Nginx environments where two distinct users, WEBSERVER-USER and PHP-FPM-USER, are involved. NPP offers a more direct solution without requiring any external NGINX modules, such as the Cache Purge module. This plugin directly traverses the cache directory and clears the cache when the permissions are properly granted for the PHP-FPM-USER to access the Nginx cache directory. To automate the granting of necessary permissions to PHP-FPM-USER, a pre-made bash script is provided that must be run manually on the host server under the **root**.
47
+
This project addresses the challenge of automating Nginx cache purging and preloading in WordPress environments where two distinct users, WEBSERVER-USER and PHP-FPM-USER, are involved. NPP provides a direct solution without relying on external Nginx modules, such as the Cache Purge module. Instead, NPP traverses the cache directory and clears the cache, provided the PHP-FPM-USER has the necessary permissions to access the Nginx cache directory.
48
+
49
+
To facilitate this, a pre-configured bash script is included, which must be run manually on the host server under the **root** user to grant the required permissions to the PHP-FPM-USER.
48
50
49
51
### Problem Statement
50
52
@@ -58,7 +60,6 @@ This project addresses the challenge of automating Nginx FastCGI cache purging a
58
60
59
61
### Solution
60
62
61
-
~~Solution involves combining **inotifywait** with **setfacl**:~~ ❗️This approach is deprecated.<br/>
62
63
Use **bindfs** to create a FUSE mount of the original Nginx Cache Path, granting read and write permissions to the PHP-FPM-USER.
63
64
64
65
## Installation Instructions
@@ -71,17 +72,6 @@ To implement this solution:
71
72
72
73
The `install.sh` script serves as a wrapper for executing the main `fastcgi_ops_root.sh` script from [psaux-it.github.io](https://github.com/psaux-it/psaux-it.github.io). This script is designed for the **FastCGI Cache Purge and Preload for Nginx** WordPress plugin (NPP), which can be found at [Official WordPress Plugin Repository](https://wordpress.org/plugins/fastcgi-cache-purge-and-preload-nginx/).<br/>
73
74
74
-
----
75
-
76
-
❗️This approach is deprecated.
77
-
78
-
~~Mainly, in case your current web server setup involves two distinct users, **WEBSERVER-USER** (nginx or www-data) and **PHP-FPM-USER**, the solution proposed by this script involves combining Linux server side tools
79
-
**inotifywait** with **setfacl** to automatically grant write permissions to the **PHP-FPM-USER** for the corresponding **Nginx Cache Paths**, which are matched either automatically or via a manual configuration file.~~
80
-
81
-
----
82
-
83
-
📣 **New Approach**
84
-
85
75
The script first attempts to automatically identify the PHP-FPM-USER (also known as the PHP process owner or website user) along with their associated Nginx Cache Paths. If it cannot automatically match the PHP-FPM-USER with their respective Nginx Cache Path, it provides an easy manual setup option using the `manual-configs.nginx` file.
86
76
87
77
In environments with two distinct user roles—the WEBSERVER-USER (nginx or www-data) and the PHP-FPM-USER —this script automates the management of Nginx Cache Paths. **It utilizes `bindfs` to create a `FUSE` mount of the original Nginx Cache Paths, enabling the PHP-FPM-USER to write to these directories with the necessary permissions.** This approach resolves permission conflicts by granting the PHP-FPM-USER access to a new mount point, while keeping the original Nginx Cache Paths intact and synchronized.
These instructions guide you through setting up the NPP plugin in environments where `PHP-FPM-USER` and `WEBSERVER-USER` are distinct, manually, without the automation script **install.sh**
106
+
107
+
#### Prerequisites
108
+
-**Web Server:**`NGINX` configured with caching.
109
+
-**Example Users:**
110
+
-`PHP-FPM-USER` (PHP process owner, e.g., `psauxit`).
111
+
-`WEBSERVER-USER` (commonly `nginx` or `www-data`).
112
+
-**Tools:** A Linux-based server with **bindfs** installed.
0 commit comments