Welcome! Log In Create A New Profile

Advanced

Re: limit_rate_after support variables

Miroslav Novy
August 30, 2018 03:02AM
Hi,
we are interested :)

I tried your patch with actual sources, the solution is very similar to my,
you just use the functions. It is better.

I tried it with this configuration:

....
location / {
root /var/www/default/;
index index.html index.htm;

set $my_limit_rate 2k;
set $my_limit_rate_after 2m;

limit_rate $my_limit_rate;
limit_rate_after $my_limit_rate_after;

access_by_lua_block {
ngx.var.my_limit_rate = '4k'
ngx.var.my_limit_rate_after = '10m'
}
}
...

Settings of limit_rate_after works good :) But settings of limit_rate
throws warning and value is always set to zero. The problem is that they
try to retrieve the value of the variable before it is set by the set
command.

2018/08/28 10:36:22 [warn] 8180#0: *1 using uninitialized "my_limit_rate"
variable, client: 10.255.255.10, server: localhost, request: "GET
/iloveyou_words.mp4 HTTP/1.1", host: "mira-nginx.dev.srw.cz"
2018/08/28 10:36:22 [debug] 8180#0: *1 http script var: ""
2018/08/28 10:36:22 [debug] 8180#0: *1 http cl:-1 max:1048576
2018/08/28 10:36:22 [debug] 8180#0: *1 rewrite phase: 2
2018/08/28 10:36:22 [debug] 8180#0: *1 http script value: "2k"
2018/08/28 10:36:22 [debug] 8180#0: *1 http script set $my_limit_rate

Can you help me with this?

Thanks
Míra Nový
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

limit_rate_after support variables

Miroslav Novy 338 August 14, 2018 04:24AM

Re: limit_rate_after support variables

ru@nginx.com 75 August 27, 2018 07:30AM

Re: limit_rate_after support variables

Miroslav Novy 99 August 27, 2018 09:38AM

Re: limit_rate_after support variables

ru@nginx.com 80 August 27, 2018 12:02PM

Re: limit_rate_after support variables

Miroslav Novy 70 August 28, 2018 03:24AM

Re: limit_rate_after support variables

ru@nginx.com 69 August 29, 2018 07:44AM

Re: limit_rate_after support variables

Miroslav Novy 87 August 30, 2018 03:02AM

Re: limit_rate_after support variables

Miroslav Novy 66 October 17, 2018 06:50AM

Re: limit_rate_after support variables

ru@nginx.com 41 November 20, 2018 09:12AM

Re: limit_rate_after support variables

Miroslav Novy 36 November 21, 2018 06:12AM

Re: limit_rate_after support variables

Miroslav Novy 48 November 21, 2018 09:52AM

Re: limit_rate_after support variables

ru@nginx.com 39 December 06, 2018 09:46AM

Re: limit_rate_after support variables

Miroslav Novy 45 December 10, 2018 08:32AM

Re: limit_rate_after support variables

Miroslav Nový 17 February 25, 2019 06:08AM

Re: limit_rate_after support variables

ru@nginx.com 21 February 26, 2019 03:00AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 95
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready