In the ingress networking - 1 practice test question 21, there's the configurati . . .

Dhawan Shringi:
In the ingress networking - 1 practice test question 21, there’s the configuration of annotations: rewrite-target, however I am not quite about to follow. Can anyone please help elaborating on why there was this need of rewrite-target?

Mayur Sharma:
@Dhawan Shringi Rewrite annotation is specific to ingress controller.
It is used to determine which endpoint to redirect on the service.

Your Ingress resource defined paths , but may be the service you want to redirect do not expose that path, so to redirect from ingress path to service endpoint, rewrite annotation is used

Mohamed Ayman:
If you need to control the ingress traffic redirection and the return code using a rewrite rule, then you need to use a return directive after the rewrite directive. More info here: https://www.nginx.com/blog/creating-nginx-rewrite-rules|https://www.nginx.com/blog/creating-nginx-rewrite-rules.