Im trying to implement a gateway with openresty, which put heavy logic in access_by_lua
.
As this reply sugguests, I put main logic into run_worker_thread
call.
I noticed that
no ngx_lua API can be used in the function_name
function
So I move as many of those calls as possible out of the main logic, by fetch information in advance, execute message modifications, deny requests afterwards, etc.. But I wonder is it really impossible to use any of ngx_lua API, say ngx.re.*
, ngx.encode_base64
, ngx.decode_base64
, ngx.escape_uri
, ngx.unescape_uri
, and even ngx.config.*
, ngx.log
, ngx.shared
.