I guess that the question is about the lua variable scope rather than nginx. you should give the simplest lua script to reproduce the question in the mail.
About lua variable scope, you can take a look at this <https://github.com/openresty/lua-nginx-module#lua-variable-scope> writen by agentzh:) 2016-08-11 15:04 GMT+08:00 石磊 <shi...@qiyi.com>: > Hi, > > > > I am using nginx 1.4, and I did fetch the "ngx.var.remote_addr" more than > once in lua script, but strange thing is sometimes I will get different > “$remote_addr” in different line in the same lua script file. > > Some more information: > > 1. I hook the lua script at rewrite_by_lua_file stage > > 2. This happens when the client has more than one ip address with > different Operators. > > 3. The “remote_addr” I got are the ip addresses the client have > from different Operators. > > > > I want to know how this happen, it is by design that the “$remote_addr” > could be changed for a http request? > > > > Thanks! > > > > *石 磊* > > 技术产品中心云平台系统网络 > > > > [image: 邮件签名logo] > > > > 爱奇艺公司 > > 地址:北京市海淀区海淀北一街2号鸿诚拓展大厦17层 > > 邮编:100080 > > 手机:+86 138 1180 3496 > > 电话: > > 传真:+86 10 6267 7000 > > 邮箱:shi...@qiyi.com > > 网址:*www.iQIYI.com <http://www.iQIYI.com>* www.ppstream.com > > > > _______________________________________________ > nginx mailing list > nginx@nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx >
_______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx