--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
我的理解,1 ,rewrite_by_lua也是可以运行在server_rewrie阶段的,和rewrite指令一样的2,但如果server块和location块同时配置了rewrite_by_lua指令,这时候的server块的rewrite_by_lua指令是被忽略了的)。
3,不知道你是不是这个意思呀。如果是的话,解决办法就是:在location块中的rewrite_by_lua中加入需要在server块中的进行的逻辑)另外好奇的是,你们从nginx切到Openresty,感觉如何现在?
在 2016年9月6日星期二 UTC-7下午11:58:17,xiaooloong写道:厂里运行了多年的 nginx 升级成了 openresty ,原来的配置文件已经有几十个 server rewrite 和上百个 location 了(多数 location 里还是 rewrite last)最近遇到不少奇怪的需求,要对请求的 url 参数和 user-agent 做判断和变换,然后做 http 跳转。本来想把所有的 server_rewrite 替换成 rewrite_by_lua 实现,结果发现等到 lua 运行,uri 甚至已经被 location 里的 rewrite 重写过很多次了。内心是崩溃的请问有没有支持 server_rewrite 阶段的计划呢?