The access_by_lua_block doens't seem to get executed when called from a capture. Something like:
location /capture {
content_by_lua_block {
ngx.say(ngx.location.capture("/real").body)
}
}
location /real {
access_by_lua_block {
-- won't execute
}
}
rewrite_by_lua and content_by_lua both fire, just not access_by_lua.