apisix icon indicating copy to clipboard operation
apisix copied to clipboard

docs: we can configure the uri field in redirect plugin with the host

Open starsz opened this issue 2 years ago • 1 comments

Current State

Hello, when I read the doc of the "redirect" plugin, https://apisix.apache.org/docs/apisix/plugins/redirect/ I can't get find the way that we can configure the redirect to a url like this https://apisix.apache.org/docs But in fact, we support it.

For example:

curl http://127.0.0.1:9180/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '{
    "methods": ["GET"],
    "uri":"/*",
    "host":"test.com",
    "plugins":{
        "redirect":{
            "ret_code":301,
            "uri":"https://apisix.apache.org/docs"
        }
    }
}'
image

Desired State

So I want to add some description of configuring the uri with the host head. Else it will mislead users that we don't support it.

starsz avatar Sep 20 '22 02:09 starsz

Also, there is a trap that only url leads by scheme will be in effective. URLs like apisix.apache.org will be handled as the relative url.

cc @nic-6443

tokers avatar Sep 20 '22 09:09 tokers

@starsz please assign to me ❤️

Hazel6869 avatar Oct 08 '22 09:10 Hazel6869

@starsz please assign to me ❤️

Finished. Look forward to your PR !

starsz avatar Oct 08 '22 09:10 starsz