apisix
apisix copied to clipboard
docs: we can configure the uri field in redirect plugin with the host
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"
}
}
}'

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.
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
@starsz please assign to me ❤️
@starsz please assign to me ❤️
Finished. Look forward to your PR !