You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/05/24 11:37:51 UTC

[GitHub] [apisix-ingress-controller] gxthrj commented on a change in pull request #480: feat: support rewrite annotation

gxthrj commented on a change in pull request #480:
URL: https://github.com/apache/apisix-ingress-controller/pull/480#discussion_r637882693



##########
File path: docs/en/latest/concepts/annotations.md
##########
@@ -59,3 +59,12 @@ Blocklist Source Range
 
 You can specify the denied client IP addresses or nets by the annotation `k8s.apisix.apache.org/blocklist-source-range`, multiple IP addresses or nets join together with `,`,
 for instance, `k8s.apisix.apache.org/blocklist-source-range: 127.0.0.1,172.17.0.0/16`. Default value is *empty*, which means the sources are not limited.
+
+Rewrite Target
+--------------
+
+You can rewrite requests by specifying the annotation `k8s.apisix.apache.org/rewrite-target` or `k8s.apisix.apache.org/rewrite-target-regex`.
+
+The annotation `k8s.apisix.apache.org/rewrite-target` controls where the request will be forwarded to.
+
+If you want to use regex and match groups, use annotation `k8s.apisix.apache.org/rewrite-target-regex` and `k8s.apisix.apache.org/rewrite-target-regex-template`. The first annotation contains the matching rule (regex), the second one contains the rewrite rule. For example, `/app(/|$)(.*)` and `/$2`. Both annotations must be used together, otherwise they will be ignored.

Review comment:
       Had better to add a demo for this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org