apisix icon indicating copy to clipboard operation
apisix copied to clipboard

proxy-rewrite plugin not support multi regex_uri

Open ipanocloud opened this issue 3 years ago • 9 comments

Description

"proxy-rewrite": { "regex_uri": [ "(^/message/message-center-mqtt-client/(.*)|^/message/internal/message-center-mqtt-client/(.*))", "/$1" ] } see this case

ipanocloud avatar Jul 28 '22 06:07 ipanocloud

{
    "proxy-rewrite":{
        "regex_uri":[
            "^(/message/message-center-mqtt-client/|/message/internal/message-center-mqtt-client/)(.*)",
            "/$1"
        ]
    }
}

ipanocloud avatar Jul 28 '22 07:07 ipanocloud

see https://apisix.apache.org/docs/apisix/plugins/proxy-rewrite/

Hazel6869 avatar Jul 28 '22 09:07 Hazel6869

@ipanocloud May I know the use case or pain point that you're facing? Currently, it's indeed that only one regex_uri is supported .

tokers avatar Jul 29 '22 01:07 tokers

I think we need to make two improvements: first, the size of the regex_uri array is marked as two on the document. later, we are doing functional optimization, multiple regex_uri supported . cc @spacewander what do you think about this.

Hazel6869 avatar Jul 29 '22 02:07 Hazel6869

@Hazel6869 Could you provide some reasons (use cases or the other) to make these two improvements? And what do you want to see after the improvements?

spacewander avatar Jul 29 '22 06:07 spacewander

@spacewander I think the first one is the optimization of the document, the status is easy to misunderstand (ab ---> ababab), the second, multiple regex_uri supported needs to be evaluated.

Hazel6869 avatar Jul 29 '22 06:07 Hazel6869

Let's start by understanding what problems are solved by supporting multiple regex_uri. cc @ipanocloud

tzssangglass avatar Aug 01 '22 01:08 tzssangglass

Hello, We are facing the same problem while migrating Gateway from Nginx to apisix. Cause we have lots of Rewrite rule

Mar1usSo avatar Sep 06 '22 02:09 Mar1usSo

@Hazel6869 Please take a look when you have time.

tokers avatar Sep 06 '22 11:09 tokers

This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Aug 23 '23 10:08 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

github-actions[bot] avatar Sep 06 '23 10:09 github-actions[bot]