Nginx has announced release 12 of NGINX Plus, the paid version of the popular NGINX open source web server. NGINX Plus R12 brings a new configuration-sharing feature aimed to simplify clustering, official support for the nginScript language, and improvements in monitoring and instrumentation, caching, and reliability.
Configuration sharing is a new mechanism that allows to push the same configuration across a cluster of NGINX nodes. Node clustering is used to ensure high availability, such as when using an active-passive configuration, where one or more inactive NGINX nodes were added to provide redundancy to the primary node, or an active-active, where two or more NGINX nodes are used to handle traffic at the same time. NGINX Plus R12 introduces a new cluster configuration, where one node plays the role of master, while the rest act as peers. The master’s configuration can be shared across all peers using the new nginx-sync.sh
command, which makes sure the configuration is valid for each peer and restarts them, or rolls it back in case of problems. This feature can also be used to reliably push configuration from a staging server to a cluster of production servers.
Another notable change brought by version 12 is a number of enhancements to nginScript, a JavaScript-based language used to customize NGINX behavior, including support for additional String methods and ECMAScript 6 Math methods and constants. More importantly, nginScript is now considered stable. NginScript is available for both the paid and open source versions of NGINX and extends the syntax used in configuration files. It allows to create custom traffic-handling solutions, such as load-balancing algorithms, custom session persistence, and even implementing simple web services, says Nginx.
As mentioned, NGINX Plus R12 also brings improvements in the following areas:
- Statistics: new metrics are available such as server response times, shared memory zone utilization, and error codes for TCP/UDP services.
- Caching: the RFC 5861
stale-while-revalidate
andstale-if-error
policies are now supported and cache revalidate can be executed in the background. - Health-check: to improve reliability, NGINX Plus 12 can delay sending traffic to newly added nodes until they pass the configured health check.
NGINX Plus 12 also includes some changes in behavior, such as the internal cache format, changes to configuration syntax when using the queue
directive, and more. Make sure you read about them in the official announcement.