How to redirect to the upstream address configured by Konga in the custom plugin of Kong?

228 Views Asked by At

For example, if the parameters of the plugin are configured with 1, after a period of business logic analysis, it will jump to upstream1, and if configured with 2, it will jump to 2.I try to do,but fail.It always redirect to upstream1 because my route's server config is upstream1 .

function MyPlugin:access(plugin_conf) 

kong.service.set_upstream("upstream1Name")

I know it is easy to do it in openresty config file by

proxy_pass http://$backend/myMethod

0

There are 0 best solutions below