请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

dep.lua文件的问题

在文件的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行代码,则能够正常进行访问控制.

想问下老师碰到过这种错误吗?

正在回答 回答被采纳积分+3

插入代码

1回答

Jeson 2018-04-30 17:04:57

没有遇到这个错误,从你发的错误描述来看,感觉在dep.lua:29,这里的ngx.say("value key: ",res,clientIP)是多余的。

attempt to call ngx.exec after sending out response headers

这个错误的意思是说,Nginx已经发出响应给客户端了,以后还在执行ngx.exec。

所以,我感觉是配置的问题

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号