Nginx eval module (v 1.0.1) |
rus eng |
Module for nginx web server evaluates response of proxy or memcached module into variables.
Module executes configuration block specified by eval directive and evaluates the response into variables. The configuration block must contain memcached_pass or proxy_pass directives.
Specifies names of variables to evaluate and block with proxy_pass or memcached_pass directives. The maximal number of variables is 8. Eval block is executed before rewrite module, therefore all configuration of rewrite module must be specified inside eval block. Example:
location / { set $foo bar; eval $var { # $foo is empty proxy_pass http://backend/$foo; } }
location / { eval $var { set $foo bar; # $foo is 'bar' proxy_pass http://backend/$foo; } }
For the same reason eval block is ineffective inside if and limit_except blocks, but instead if and limit_except blocks are effective inside eval block.
Evaluation of response into variables is controlled by it's content type (the value of Content-Type header). The following content types are recognized:
In order to override content type returned by the proxy or memcached, it is necessary to use eval_override_content_type directive.
Enables escalation of error in eval block to upper level of configuration. For example this configuration:
location / { eval_escalate off; eval $var { set $foo bar; return 403; } return 405; }
returns HTTP error 405, whereas this configuration:
location / { eval_escalate on; eval $var { set $foo bar; return 403; } return 405; }
returns HTTP error 403.
Specifies content type to use instead of content type provided by memcached or proxy.
eval $var { set $memcached_key $1; memcached_pass 192.168.2.1; }
Latest version 1.0.1:
File | MD5 | SHA1 |
nginx_eval_module-1.0.1.tar.gz | 570b6f7e40e489c5846ffca725226edb | fa1ceef301a83f038ed0fa1ea5634be3c600002d |
nginx_eval_module-1.0.1.zip | cfda9250f5b596714312a78e314fc94e | 450e7194c4b226be7a1fdd2285e302d14729bb6f |
http://github.com/vkholodkov/nginx-eval-module/tree/master
Download sources from one of the links above. Unpack the archive:
tar xvzf nginx_eval_module-1.0.1.tar.gz
Configure nginx with additional module:
cd <path to nginx sources> ./configure --add-module=<path to eval module sources> make make install
nginx -- is a web-server, developed by Igor Sysoev.
The licence of above-described module is BSD You should have received a copy of licence along with the source code. If you do not agree to terms and conditions of this licence, you must destroy all copies of module's sources codes on all your computers as well as binary files compiled from those sources.
Valery Kholodkov valery+nginx@grid.net.ru
Please use address extension while composing an Email to me.
Copyright (C) 2009 Valery Kholodkov