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

1
  • 2
    Maybe a workaround using ngx.timer.at(0, ...) described here will be suitable for you? Commented Nov 16, 2020 at 11:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.