��ã�
�ʹ�ngx.on_abort()ʱ�������������һ���лл��
ҵ������һ����ʱ���������s����ͨ��esty��������ͨ���ʸ÷�������δ����Ӧʱ�ǰ�ر������ϣ��openresty�־�����һ���
�鿴API���ngx.on_abort()�����ο�˵����������ǰ�ر��������ص���δ������־�û���κ��������־������������ǰ���лл��
openresty�汾1.11.2.2������ϳ�������������˿ڣ�ʾ���Ƭ�����
...
http{
lua_check_client_abort on;
server {
listen 80;
location / {
rewrite_by_lua_block{
local function exit()
ngx.log(ngx.ERR,"client abort!!")
end
local ok,err=ngx.on_abort(exit)
if not ok then
ngx.log(ngx.ERR,"failed to register the on_abort callback: ",err)
ngx.exit(500)
end
}
proxy_pass http://127.0.0.1:8080;
}
}
}