njs 0.8.0 has been released. This release adds a shared dictionary for http and stream, and a global ngx property.
njs exists as an nginx plug-in. It is a subset of JavaScript/ECMAscript and implements most of the JavaScript language functions. It does not fully comply with the ECMAScript standard and discards the difficult parts of JavaScript. njs is not implemented by the V8 engine, but by a smaller virtual machine with lower energy consumption and more suitable for nginx application scenarios. It can be understood that nginx has implemented its own set of lexical analysis for it.
As a plug-in for nginx, njs is installed by recompiling nginx.
New version download link: http://nginx.org/en/docs/njs/install.html
major changes
nginx modules
- Change: Delete the special handling of prohibited headers in the Fetch API introduced in 0.7.10
- Change: remove the and method which has been deprecated in the module since 0.5.0
http
r.requestBody()
r.responseBody()
- Change: The module throws an exception
http
when filteringr.internalRedirect()
- Feature: introduce global nginx properties -
ngx.build
,ngx.conf_file_path
,ngx.error_log_path
,ngx.prefix
,ngx.version
,ngx.version_number
andngx.worker_id
- Feature: Introduce directives for http and stream
js_shared_dict_zone
for declaring shared dictionaries between worker processes - Improvement: Add compile-time option to disable njs module. For example, to disable libxslt related code:
NJS_LIBXSLT=NO ./configure .. --add-module=/path/to/njs/module