Redirect from a plugin's custom logic (disable other plugins per request)


#1

Hey,

I am developing a custom plugin for routing based on consumer data. I have a case when I want to redirect without other plugins bein applied.

My question is, is it possible to prevent the execution of other plugins when calling kong.service.set_target() (just after that), e.g. redirect to an URL just after that call with path, all passed arguments and body payloads (and not wait for all other plugins to execute)?

In particular, I would like to disable rate-limiting plugin on demand, per request.

Any suggestions to that?


#2

I was able to solve it myself. I then went with ngx.redirect(x, 307) instead of kong.service.set_target() . It seems it works well for my case. I haven’t spotted any problems yet.