NGINX Unit 1.16.0 Application Server Release

Took place application server release NGINX Unit 1.16, which develops a solution to ensure the launch of web applications in various programming languages ​​(Python, PHP, Perl, Ruby, Go, JavaScript / Node.js and Java). Under the control of NGINX Unit, several applications in different programming languages ​​can run simultaneously, the launch parameters of which can be changed dynamically without the need to edit configuration files and restart. The code is written in C language and spreads licensed under Apache 2.0. You can get acquainted with the features of NGINX Unit in announcement first release.

In the new version:

  • Added by support for load balancing in round-robin mode. For example, to distribute the load on two servers 192.168.0.100 and 192.168.0.101 and send twice as many requests to the second server, you can use the following construction:

    "upstreams": {
    "rr-lb": {
    "servers": {
    "192.168.0.100:8080": { },
    "192.168.0.101:8080": { "weight": 2 }
    }
    }
    }

  • Implemented the ability to set flexible rules for routing requests similar to the functionality "try_files" in nginx. An additional route is specified using the "fallback" directive, which fires if the requested file is not found in the path defined through the "share" directive. For example, in order to call a PHP handler if there is no file in the /data/www/ directory, you can specify:

    {
    "share": "/data/www/",
    "fallback": {
    "pass": "applications/php"
    }
    }

    The use of nested “fallback” blocks is allowed. For example, if the file is not in /data/www/, you can try to retrieve it from /data/cache/, and if it is not there either, redirect the request to another backend:

    {
    "share": "/data/www/",

    "fallback": {
    "share": "/data/cache/",

    "fallback": {
    "proxy": "http://127.0.0.1:9000"
    }
    }
    }

  • Configuration parameters loaded in JSON format provide removal of JavaScript-style comments (“//…” and “/* … */”) and cleaning of byte sequence markers (UTF-8 BOM), which can be useful in case of manual editing of parameters in JSON.
  • Reduced memory consumption by flushing the body of very large requests to disk.

Source: opennet.ru

Add a comment