Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Location / must be the last one
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed May 4, 2016
1 parent 6ed5cbf commit d229b99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ingress/controllers/nginx/nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d229b99

Please sign in to comment.