How to forward to the original uri in the balancer.lua, when it have change in the plugin? #6388
Replies: 6 comments 2 replies
-
In other words, in the balancer phase, can I still modify the URI? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply. I don't fully understand your content. In addition, my purpose is to work in balancer.Lua, when all the upstream unavailable, the request is transferred to another backup gateway , so the URI should be restored to its original appearance. |
Beta Was this translation helpful? Give feedback.
-
I just remind you that you need Can you show how you modified it? |
Beta Was this translation helpful? Give feedback.
-
I modify it like this: |
Beta Was this translation helpful? Give feedback.
-
This code will only be executed during the balancer retry phase. I've thought about it for a while, and your needs are a bit specific and a bit tricky to implement. I'm turning this issue into a discussion because it's not related to the project. |
Beta Was this translation helpful? Give feedback.
-
Issue description
Dear all, I use the proxy-rewrite to change the uri, then in the balancer.lua, if all the backupend server is avalable, I want to forwards the request to other cluster , so I want to set the uri to the original, but I can not do it.
I try it like this : ctx.var.upstream_uri = ctx.old_upstream_uri
but it not work now, It still forwards the modified URI, not the original.
Environment
apisix version
):1.11.0uname -a
):center os 7nginx -V
oropenresty -V
):curl http://127.0.0.1:9090/v1/server_info
to get the info from server-info API):luarocks --version
):Beta Was this translation helpful? Give feedback.
All reactions