njs scripting language

njs is a subset of the JavaScript language that allows extending nginx functionality. njs is created in compliance with ECMAScript 5.1 (strict mode) with some ECMAScript 6 and later extensions. The compliance is still evolving.

Use cases

See examples and blog posts for more njs use cases.

Basic HTTP Example

To use njs in nginx:

There is also a standalone command line utility that can be used independently of nginx for njs development and debugging.