From d229b995f99f45f76467ca328f6a4cb2437a8318 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Wed, 4 May 2016 08:56:03 -0300 Subject: [PATCH] Location / must be the last one --- ingress/controllers/nginx/nginx/nginx.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ingress/controllers/nginx/nginx/nginx.go b/ingress/controllers/nginx/nginx/nginx.go index 0a670a3b86..bc744a3b26 100644 --- a/ingress/controllers/nginx/nginx/nginx.go +++ b/ingress/controllers/nginx/nginx/nginx.go @@ -88,12 +88,13 @@ type Location struct { } // LocationByPath sorts location by path +// Location / is the last one type LocationByPath []*Location func (c LocationByPath) Len() int { return len(c) } func (c LocationByPath) Swap(i, j int) { c[i], c[j] = c[j], c[i] } func (c LocationByPath) Less(i, j int) bool { - return c[i].Path < c[j].Path + return c[i].Path > c[j].Path } // NewDefaultServer return an UpstreamServer to be use as default server that returns 503.