nginx / njs-acme

Nginx NJS module runtime to work with ACME providers like Let's Encrypt for automated no-reload TLS certificate issue/renewal.
Apache License 2.0
57 stars 9 forks source link

Allow external cache invalidation #58

Open NetForce1 opened 5 months ago

NetForce1 commented 5 months ago

Is your feature request related to a problem? Please describe

When running nginx in a cluster with shared storage for njs-acme, you need to be able to invalidate the cache across the cluster. Otherwise only a single node will use the updated certificate.

Describe the solution you'd like

A function exported from acme.js that clears the cache. Can be either based on the request, or the whole cache. This would make it possible for the node that renews the certificate to call an enpoint at the other nodes to clear the cache.

To be able to do this, it would probably be cleanest to export a function that returns structured information (like clientAutoModeInternal), or add the ability for registering a hook that is called on certificate renewal. One can than implement calling the other nodes in some custom njs code.