I developed a new plugin that basically receives a call and directs it, according to some criteria, to a configured target.
To accomplish this targeting, I'm using
kong.service.set_target("server.server", 80)
With that I get an error similar to this:
[error] 45212#0: *310 [lua] init.lua:1168: balancer(): failed to set the current peer (address: http://server.server port: 80): invalid host while connecting to upstream, client: 00.000.00.00
The Host is directly accessible from the machine where KONG is. I tried to add the following configuration: dns_resolver but without success too and the resolv.conf file has the correct settings
From my research, the error occurs at this moment:
init.lua[1166] - set_current_peer(balancer_data_ip, balancer_data_port, pool_opts)
From what I understand, this method does not support to be used with a domain...
Is there any way out for this? Unfortunately I need to use the domain for this upstream.
Is there any way to upstream using set_target to a domain in Kong?