lua possibilities/limitations

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


Hi,

...
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

X-Limit:

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

Cheers,

Marcus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110214/a103a433/attachment.html>


More information about the nginx mailing list