ngx.lua中遇到的小问题

作者: 胡 志伟 分类: ngx_lua, 开发代码 发布时间: 2013-09-26 08:40 ė6评论关闭

在使用ngx.redirect 到一个新的地址时,错误日志提示:

lua entry thread aborted: runtime error: attempt to call ngx.redirect after sending out the headers

检查后发现,前面function中已经有ngx.say的过程,所以导致此问题。注释掉rediect前的所有say操作和print操作后即可