-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set variable inoperative!! #1120
Comments
我打算加入 srcache-nginx-module的模块进来, 我在openresty 上 用rewrite_by_lua 就非常正常。 下面是openresty 正常的写法, 都是ok的。 location /test_foo {
} |
The apisix run both ".access" and ".rewrite" in the "access" phase. https://github.com/apache/incubator-apisix/blob/master/bin/apisix#L334-L336 |
好的,明白了, 我的修改是 set_by_lua 和 rewrite_by_lua 2个执行阶段的,所以在access就无效了。 |
Hi:
我开发一个插件, 我在 bin/apisix 中加入初始化变量,我发现一个奇怪的问题:
如果 我设置这个变量为为空的时候
location / {
......
set $skip '';
......
}
我可以在插件 /lua/apisix/plugins目录下通过下面的rewrite阶段去修改这个变量, 并且后面的服务可以用到修改后的值。 是正常的
function _M.rewrite(conf, ctx)
ngx_var.skip = 0
end
但如果我改成下面的情况, 初始化这个值得时候设置为1 ,此时,我的插件就不其作用了,修改后的值似乎没有生效, 我测试了很多遍, 一直无法解决。 能帮忙确认下是什么原因吗?
location / {
......
set $skip 1 ;
......
}
The text was updated successfully, but these errors were encountered: