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
To properly integrate Ghost with the VERNICE.JS middleware and enable selective cache purging for Varnish, you need to configure Ghost to use Hooks via Web API. Below are the detailed steps to perform this configuration starting from the provided image.
39
41
40
42
Access the Ghost admin panel and go to Settings.
@@ -54,7 +56,9 @@ Repeat the process to add additional webhooks that cover all events of interest,
To ensure that the Vernice.js middleware remains active and starts automatically upon system reboot, it is necessary to configure a systemd unit. This is crucial to ensure the service is always available to handle webhooks sent by Ghost. To achieve this, we will create a configuration file in /lib/systemd/system/vernice.service containing the following code:
59
63
60
64
```systemd
@@ -75,7 +79,9 @@ WantedBy=multi-user.target
75
79
76
80
Remember to adjust the paths based on the location of the vernice.js file. In the systemd unit example above, it is assumed that the script is running in the /root directory with root privileges.
Regarding Varnish configuration, due to company policy, we do not delve into the specifics of the configuration and the related VCL. We use a specific and customized version extended with Inline C. However, the configuration can be applied simply by ensuring that the recv block in Varnish is capable of correctly handling the PURGE command by performing a selective BAN of the URL.
80
86
81
87
Below is a brief snippet of the configuration (in VCL - Varnish Cache Language) where the requester's IP is checked (it must match either the machine's IP or the localhost IP) before proceeding with the BAN of the URL passed by the vernice.js middleware.
@@ -98,7 +104,7 @@ error 405 "Not allowed.";
98
104
99
105
}
100
106
```
101
-
###License
107
+
## License
102
108
This project is licensed under the AGPL 3.0 License https://www.gnu.org/licenses/agpl-3.0.en.html
103
109
Please contribute, fork and expand it. U Are Welcome !
0 commit comments