how to http request with Lua when Nginx start and restart

215 views
Skip to first unread message

Tuang Haumun

unread,
Nov 16, 2020, 4:45:19 AM11/16/20
to openresty-en

I am using Lua Nginx module in my nginx server.

I have a Lua script which is execute by init_worker_by_lua_file in nginx.conf so the script will execute when nginx start and restart. What the Lua script does is, it request rest api to some server and just retrieve the response.

In this case, I use curl for access the api, is there any way without using curl?

I already try ngx.location.capture and ngx.exec those are not work for init_worker_by_lua_file


thanks

Reply all
Reply to author
Forward
0 new messages