You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are on the migration path towards a Kubernetes orchestrated setup, and are using Ingress with the nginx-ingress-controller. Which by the way, works pretty awesome! Thanks!
We are running into issues when using the annotation rewrite-target. When trying to hit the url: https://api.dev.example.com/documents/someservice/config I would expect the requests to be forwarded to the default path in my ingress: / - however it hits the /someservice. When looking into the template.go I see the following:
// buildLocation produces the location string, if the ingress has redirects
// (specified through the ingress.kubernetes.io/rewrite-to annotation)
func buildLocation(input interface{}) string {
location, ok := input.(*ingress.Location)
if !ok {
return slash
}
path := location.Path
if len(location.Redirect.Target) > 0 && location.Redirect.Target != path {
return fmt.Sprintf("~* %s", path)
}
return path
}
As I understand, this means that there will be a willcard before /someservice, which is not what I expect. I would expect that the path is api.dev.example.com/someservice and then a post wildcard.
@kaspernissen thank you for the detailed report. The current code generates a regular expression that matches any part of the URL. The location location ~* /someservice should be location ~* ^/someservice to avoid errors.
Can you test if the image quay.io/aledbf/nginx-ingress-controller:0.63 solves the issue?
Thanks
nginx-ingress-controller version: 0.9.0-beta1
We are on the migration path towards a Kubernetes orchestrated setup, and are using Ingress with the nginx-ingress-controller. Which by the way, works pretty awesome! Thanks!
We are running into issues when using the annotation
rewrite-target
. When trying to hit the url:https://api.dev.example.com/documents/someservice/config
I would expect the requests to be forwarded to the default path in my ingress:/
- however it hits the/someservice
. When looking into thetemplate.go
I see the following:Which results in an nginx.conf as follows:
As I understand, this means that there will be a willcard before
/someservice
, which is not what I expect. I would expect that the path isapi.dev.example.com/someservice
and then a post wildcard.Steps to reproduce
Am i using the rewrite-target annotation wrong? And Is there some way to work around this?
The text was updated successfully, but these errors were encountered: