2

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

thirdwave
  • 75
  • 1
  • 7
  • 2
    Maybe a workaround using `ngx.timer.at(0, ...)` described [here](https://github.com/openresty/lua-nginx-module#cosockets-not-available-everywhere) will be suitable for you? – Ivan Shatsky Nov 16 '20 at 11:22

0 Answers0