[Solved] lua error: no resolver defined to resolve

Use the rest.http module to request no resolver defined to resolve, the error log prompts attempt to index local 'resp', and the code is as follows.

local resp, err = httpc:request_uri("http://xxx.com",{method = "GET",keepalive = false}) 
	ngx.say(  err)

Solution: add DNS configuration, and add resolver configuration in conf configuration file. As shown in the figure below

Read More: