lua possibilities/limitations

Eugaia ngx.eugaia at
Mon Feb 14 13:34:59 MSK 2011


On 13/02/2011 06:02, Richard Kearsley wrote:
> location /main {
> set $myvar '';
> set $limit_rate 99;
> set $limit_rate $myvar;
As well as the points agentzh made, there is also the case here that 
$limit_rate does a check on the values that it is set to, and it must be 
a valid size (internally this is done by having a set_handler attached 
to the variable - something most variables don't have).

Here, you are trying to set it to '' (i.e. empty), and this is invalid, 
and it will :
(a) throw an error in the error log, saying that it's an 'invalid size'
(b) do nothing to the value, therefore leaving it at 99 rather than 
setting it to ''

With the config you have, most variables would result in your headers being

X-Test: 100


But you see X-Limit: 99 because of this reason.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list