Welcome! Log In Create A New Profile

Advanced

Lua Variable access bug?

Sirsiwal, Umesh
May 15, 2012 10:18PM
Hello,
We are seeing the following problem with nginx variable access from Lua.

I have the following configuration:

set $vv $http_host;
set_by_lua $i ' return ngx.log(ngx.ERR, ngx.var.http_host)';

If I comment out the first line and send SIGHUP to master process the logged variable becomes empty.

#set $vv $http_host;
set_by_lua $i ' return ngx.log(ngx.ERR, ngx.var.http_host)';

Note that if we start nginx with set $vv $http_host; commented there is no issue. The issue only exists if we start off accessing the variable from the configuration file and than remove the variable access.

I think issue exists because of the way ngx_http_variables_init_vars is written. It changes the flags in the static ngx_http_core_variables variable. During the first configuration read cycle where $http_host is indexed, the flag changes to indexed. During the second configuration read cycle where the the $http_host variable should not be indexed, the flags still remain INDEXED. That confuses ngx_http_get_variable later.

Thanks for any help.

-Umesh
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Lua Variable access bug?

Sirsiwal, Umesh 1681 May 15, 2012 10:18PM

Re: Lua Variable access bug? Attachments

agentzh 509 May 17, 2012 04:36AM

Re: Lua Variable access bug?

Maxim Dounin 496 May 17, 2012 05:04AM

Re: Lua Variable access bug?

agentzh 477 May 17, 2012 07:44AM

Re: Lua Variable access bug?

Maxim Dounin 465 May 17, 2012 09:08AM

Re: Lua Variable access bug?

agentzh 529 May 17, 2012 09:16AM

Re: Lua Variable access bug?

Sirsiwal, Umesh 487 May 17, 2012 09:38AM

Re: Lua Variable access bug?

Maxim Dounin 525 May 17, 2012 02:12PM

Re: Lua Variable access bug?

lanshun zhou 480 May 17, 2012 11:00PM

Re: Lua Variable access bug?

Maxim Dounin 592 May 18, 2012 07:10AM

Re: Lua Variable access bug? Attachments

lanshun zhou 602 May 22, 2012 06:34AM



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

Online Users

Guests: 243
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready