Hi, in one of the ingress learning path , it said the following re-direct, howev . . .

karthi Mahadev:
Hi,
in one of the ingress learning path , it said the following re-direct, however, it did not explain why we need re-direct… anyone got clue ?

You are requested to make the new application available at /pay.
Identify and implement the best approach to making this application available on the ingress controller and test to make sure its working. Look into annotations: rewrite-target as well.

Mohamed Ayman:
In some scenarios the exposed URL in the backend service differs from the specified path in the Ingress rule. Without a rewrite any request will return 404. To circumvent this you can set the annotation http://ingress.kubernetes.io/rewrite-target|ingress.kubernetes.io/rewrite-target to the path expected by the service. you can check this lecture it explain this