I am trying to figure out how to do the following:
A request arrives.
HttpLuaModule takes some action against the request. If the request is valid, then Lua will complete the processing using ngx.exit(202) . But there are some conditions that can (and will) occur during processing, and nginx can return 403, 404, 503 Errors.
What I want to do is write only requests with a 200 status code to the access logs. Basically I would like to do something like this:
location /foo { content_by_lua_file "/opt/nginx/lua/process.lua"; if (status == 200) { access_log "/path/to/the/access_log" }
I am very new to nginx and lua, so for me it is a difficult task to find out where to place and if the instruction (broadcast after content_by_lua_file or in the side lua file), and what this statement should look like if.
Vor source share