diff --git a/lua/apisix/admin/plugins.lua b/lua/apisix/admin/plugins.lua index ba4bdcc26ce7..1ae7dfe5b909 100644 --- a/lua/apisix/admin/plugins.lua +++ b/lua/apisix/admin/plugins.lua @@ -42,7 +42,7 @@ function _M.check_schema(plugins_conf) core.json.delay_encode(plugin_conf, true)) local plugin_obj = local_plugins[name] if not plugin_obj then - return false, "unknow plugin [" .. name .. "]" + return false, "unknown plugin [" .. name .. "]" end if plugin_obj.check_schema then @@ -67,7 +67,7 @@ function _M.stream_check_schema(plugins_conf) ": ", core.json.delay_encode(plugin_conf, true)) local plugin_obj = stream_local_plugins[name] if not plugin_obj then - return false, "unknow plugin [" .. name .. "]" + return false, "unknown plugin [" .. name .. "]" end if plugin_obj.check_schema then diff --git a/lua/apisix/plugins/node-status.lua b/lua/apisix/plugins/node-status.lua index d34d271c1d9b..112813a0e93e 100644 --- a/lua/apisix/plugins/node-status.lua +++ b/lua/apisix/plugins/node-status.lua @@ -17,6 +17,7 @@ local core = require("apisix.core") local ngx = ngx local re_gmatch = ngx.re.gmatch +local ngx_capture = ngx.location.capture local plugin_name = "node-status" local apisix_id = core.id.get() local ipairs = ipairs @@ -37,13 +38,7 @@ local ngx_statu_items = { local function collect() - local res, err = core.http.request_self("/apisix/nginx_status", { - keepalive = false, - }) - if not res then - return 500, "failed to fetch nginx status: " .. err - end - + local res = ngx_capture("/apisix/nginx_status") if res.status ~= 200 then return res.status end