nginx JavaScript module (original) (raw)

njs is an nginx module that extends the server's functionality through JavaScript scripting, enabling the creation of custom server-side logic and more.

Use cases

See examplesfor more njs use cases.

Basic HTTP Example

To use njs in nginx:

   location / {  
       js_content http.hello;  
   }  

}
}

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