lua no resolver defined to resolve
- 使用resty.http模块请求报
no resolver defined to resolve
,错误日志提示attempt to index local 'resp'
,代码如下所示。
local resp, err = httpc:request_uri("http://xxx.com",{method = "GET",keepalive = false}) -- 发起请求
ngx.say( err)
- 解决方案,增加
DNS
配置,在conf配置文件中增加resolver
配置。如下图所示。