在文件的20行有此行代码:ngx.say("value key: ",res,clientIP),只要之前的代码运行正常,由于没有if控制,这一行是会被执行的。然后就出现了如下错误(此时的memcache为空):
2018/04/28 22:45:29 [error] 1308#1308: *91 lua entry thread aborted: runtime error: /opt/app/lua/dep.lua:29: attempt to call ngx.exec after sending out response headers
stack traceback:
coroutine 0:
[C]: in function 'exec'
/opt/app/lua/dep.lua:29: in function </opt/app/lua/dep.lua:1>, client: 220.*.*.*, server: localhost, request: "GET / HTTP/1.1", host: "47.*.*.*"
如果注释掉第20行代码,则能够正常进行访问控制.
想问下老师碰到过这种错误吗?