Hello all,
Is there any way to run Lua code when a client times out?
I have tried different directives including log_by_lua_block, but this only
runs if the client does not time out.
For example, if I add
log_by_lua_block {
print("This message is from log_by_lua.")
}
to my Nginx configuration, the above message is only printed to the error log
when the client completes its request.
If the client timed out, this message is not printed to the error log. I
know that the client did time out because in the error log there is an entry such as:
Nov 01 20:55:16 debian-a nginx[3277]: debian-a nginx: 2021/11/01 20:55:16 [info] 3277#3277: *3 client timed out (110: Connection timed out) while waiting for request, client: 192.168.80.1, server: 0.0.0.0:80
Is there a way to run Lua code on client time out?
Your help is appreciated!