release of the application server , as part of which a solution is developed to enable the launch of web applications in various programming languages (Python, PHP, Perl, Ruby, Go, JavaScript/Node.js, and Java). Under NGINX Unit, multiple applications in different programming languages can run simultaneously, with launch parameters that can be dynamically changed without the need to edit configuration files or restart. The code is written in C and is licensed under Apache 2.0. You can explore the features of NGINX Unit at the first release.
In the new version:
- supports load balancing in round-robin mode. For example, to distribute the load between two servers 192.168.0.100 and 192.168.0.101, directing twice as many requests to the second server, you can use the following configuration:
"upstreams": {
"rr-lb": {
"servers": {
"192.168.0.100:8080": { },
"192.168.0.101:8080": { "weight": 2 }
}
}
} - the ability to set flexible request routing rules, similar to the functionality of "" in nginx. An additional route can be specified using the "fallback" directive, which triggers if the requested file is not found in the path defined by the "share" directive. For example, to call a PHP handler when the file is missing in the directory /data/www/, you can specify:
{
"share": "/data/www/",
"fallback": {
"pass": "applications/php"
}
}Nested "fallback" blocks are permitted. For instance, if the file is not in /data/www/, you can attempt to serve 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"
}
}
} - The configuration parameters loaded in JSON format support the removal of comments in JavaScript style ("//..." and "/* ... */") and the cleaning of byte order marks (), which can be helpful when manually editing parameters in JSON.
- Memory consumption is reduced by flushing the bodies of very large requests to disk.
Source: opennet.ru
