njs scripting languagenjs脚本语言

njs is a subset of the JavaScript language that allows extending nginx functionality. njs是允许扩展nginx功能的JavaScript语言的子集。njs is created in compliance with ECMAScript 5.1 (strict mode) with some ECMAScript 6 and later extensions. njs是根据ECMAScript 5.1(严格模式)和一些ECMAScript 6及更高版本的扩展创建的。The compliance is still evolving.合规性仍在发展中

Use cases用例

See examples and blog posts for more njs use cases.有关更多njs用例,请参阅示例博客文章

Basic HTTP Example基本HTTP示例

To use njs in nginx:要在nginx中使用njs:

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

Tested OS and platforms经过测试的操作系统和平台

Presentation at nginx.conf 2018在nginx.conf 2018上的介绍