Closed silverstr89 closed 3 years ago
Hi @KentAVP, currently the kong.Nginx.SetCtx()
method doesn't support "deep" keys. Calling it as kong.Nginx.SetCtx("balancer_address.host", "127.0.0.1")
is equivalent in Lua to ngx.ctx["balancer_address.host"] = "127.0.0.1"
, and not ngx.ctx.balancer_address.host = "127.0.0.1"
On a separate note, I'm not sure that setting the ctx is a documented behaviour of the balancer; it looks more like abusing some private variables, and wouldn't be surprised if a future release breaks this use. Can it be done via documented methods, like kong.Service.SetUpstream()
or kong.Service.SetTarget()
?
hi @javierguerragiraldez ! ok, i got it. i already found solution. at Access method i made my own http client and use corporate proxy inside this client.
upstream and target doesn't helps to me
I'm trying to configure corporate proxy for go kong plugin
here is my code:
of course i created test proxy server at my host: 127.0.0.1:8080
but it's not working
by plugin doc: kong.Nginx.SetCtx() sets a value in the
ngx.ctx
request context tablei made my go plugin by example https://github.com/tfabien/kong-forward-proxy/blob/master/src/access.lua where ngx.ctx.balancer_address.host = plugin_conf.proxy_host ngx.ctx.balancer_address.port = plugin_conf.proxy_port are configuring proxy
so, anyway it's not working
my dockerfile is
starting docker by:
how can i resolve it?