@aledbf
Our admin informed me that we are running following nginx-ingress on our rancher kubernetes cluster: rancher/nginx-ingress-controller:0.16.2-rancher1 So i am not sure what native ingress-nginx version it is using.
We get strange behavior for the url rewrite that parts of the url are repeated.
@stebo the link of the documentation is for the latest version (0.22.0). Keep in mind the latest version introduced a change in the rewrite-target annotation not compatible with the previous versions
To know what version are you running exactly, you need to check the ingress controller pod log. At the start you will see something like:
I checked with our admin to ask what version we had and added what you asked. And now his reply is that he upgraded to version 0.22. I retested and now the test with the alpine nginx request looks ok in the logs. But i test that with non existing url paths causing a 404.
When I test it with a not existing url on our API, it seems it strips of perfect the date part.
but when i enter then a valid one, the url gets redirected to a url without the date part and i endup with a location that is not valid anymore. Do you think that the redirect is coming from the url rewrite or does it might be a behavior of the API ?
The intention is that the url with the date part stays in the url, but that the upstream only gets the part without the date. The wanted behavior is described here : https://www.getambassador.io/reference/rewrites/
@stebo you are missing the final s in the first screenshot. Also, that error is returned by your application, not the ingress controller, so the rewrite is working
@stebo keep in mind the rewrite feature works when a client make a request to the ingress controller. If your application returns a redirect (just as an example) to /API/contracts/..... then you will get a 404 from the ingress controller. There is no rewrite of the content returned from your application.