JavaScript Added To NGINX
Written by Alex Armstrong   
Tuesday, 29 September 2015

An implementation of JavaScript called nginScript has been launched to give additional scripting capabilities to the high-performance, open source, web server NGNIX.

ngxbanner

nginScript was announced in a blog post by NGNIX creator Igor Sysoev, who also demoed it at this year's nginx.conf. According to Sysoev nginScript is not intended to replace Lua or other embedded languages in NGINX. Instead this implementation of JavaScript comes as an alternative to its existing facilities with the idea that as JavaScript is the most popular language it will help people work with NGINX. In the announcement he writes:

nginScript can be used for quick fixes, making NGINX configuration more convenient and operations more efficient. But, because it runs at the application delivery level, it will also enable you to refactor your applications for greater long-term stability, security, and scale.

nginScript comprises two parts:

  1. A custom virtual machine (VM) and byte-code compiler with a very fast start-up and tear-down time. Blocking operations, such as an HTTP subrequest, can be suspended and resumed, in the same way as other blocking operations in JavaScript.

  2. A configuration syntax for embedding snippets of JavaScript in a NGINX configuration. These snippets are evaluated at runtime, as HTTP transactions proceed. It enables the creation of powerful conditional configurations, modify requests and responses on the fly, with the ability to adjust the internal operations of NGINX specifically for each request.

With its current capabilities potential uses for nginScript include: 

  • Defend against security threats – nginScript can dynamically respond to abusive traffic sources by rate-limiting or denying requests.

  • Gain richer control over traffic – You can implement flexible control over how traffic is routed using information in the request or other sources.

  • Consolidate functions across applications – You can move duplicated functionality out of applications and into the application delivery platform.

  • Speed application development with function libraries – nginScript code can be developed, reused, improved, stored, and shared.

Sysoev adds:

In the future, we’ll add more capabilities to nginScript and broaden its scope, so you can use it for tasks such as fixing application bugs, changing business rules, personalizing the user experience, and sharding requests across servers and aggregating the replies.

 ngxsq

 

Banner

{loadposition moreNEWSlist}

 

{loadposition comment}

 

 

Last Updated ( Tuesday, 29 September 2015 )