Ngx.location.capture won't work

Hello, I write code for authorization using plugin serverless. The following piece of code doesn’t work

local res = ngx.location.capture("/auth/access/validate"\, {
  args = {
    service = m.uri_captures.nas_service\, url = "/" .. m.uri_captures.nas_service_url\,
    method = ngx.var.request_method\, token = token
  }
})

In log I see the following error:
invalid URL prefix in “://kong_upstream”, where can I change this is prefix?

I found the same problem here

I solved the problem by using lua-resty-http and httpc:request_uri, where I can define full url. And this solved my problem

1 Like