Dmitry Volyntsev
September 12, 2023 07:10PM

I'm glad to announce a new release of NGINX JavaScript module (njs).

Notable new features:
- Periodic code execution:
js_periodic direcrive specifies a content handler to run at regular
The handler receives a session object as its first argument, it also has
to global objects such as ngx.

: example.conf:
: location @periodics {
: # to be run at 1 minute intervals in worker process 0
: js_periodic main.handler interval=60s;
: # to be run at 1 minute intervals in all worker processes
: js_periodic main.handler interval=60s worker_affinity=all;
: # to be run at 1 minute intervals in worker processes 1 and 3
: js_periodic main.handler interval=60s worker_affinity=0101;
: resolver;
: js_fetch_trusted_certificate /path/to/ISRG_Root_X1.pem;
: }
: example.js:
: async function handler(s) {
: let reply = async ngx.fetch('');
: let body = async reply.text();
: ngx.log(ngx.INFO, body);
: }

Learn more about njs:

- Overview and introduction:
- NGINX JavaScript in Your Web Server Configuration:
- Extending NGINX with Custom Code:
- Using node modules with njs:
- Writing njs code using TypeScript definition files:

Feel free to try it and give us feedback on:

- Github:
- Mailing list:

Additional examples and howtos can be found here:

- Github:

Changes with njs 0.8.1 12 Sep 2023

nginx modules:

*) Feature: introduced js_periodic directive.
The directive specifies a JS handler to run at regular intervals.

*) Feature: implemented items() method for a shared dictionary.
The method returns all the non-expired key-value pairs.

*) Bugfix: fixed size() and keys() methods of a shared dictionary.

*) Bugfix: fixed erroneous exception in r.internalRedirect()
introduced in 0.8.0.


*) Bugfix: fixed incorrect order of keys in
nginx mailing list
Subject Author Posted


Dmitry Volyntsev September 12, 2023 07:10PM

Re: njs-0.8.1

Manuel September 12, 2023 07:50PM

Re: njs-0.8.1

Dmitry Volyntsev September 12, 2023 08:36PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 100
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready