diff --git a/configuration.go b/configuration.go index 4443a2508..e89755e60 100644 --- a/configuration.go +++ b/configuration.go @@ -35,7 +35,7 @@ type Server struct { } type Route struct { - Category string + Rule string Value string } diff --git a/providerTemplates/docker.tmpl b/providerTemplates/docker.tmpl index bbc0be8fe..99c439107 100644 --- a/providerTemplates/docker.tmpl +++ b/providerTemplates/docker.tmpl @@ -9,6 +9,6 @@ {{$container := index $containers 0}} backend = "backend-{{getBackend $container}}" [frontends.frontend-{{$host}}.routes.route-host-{{$host}}] - category = "Host" + rule = "Host" value = "{{$host}}.{{$.Domain}}" {{end}} \ No newline at end of file diff --git a/providerTemplates/marathon.tmpl b/providerTemplates/marathon.tmpl index bd70edeab..895d494dc 100644 --- a/providerTemplates/marathon.tmpl +++ b/providerTemplates/marathon.tmpl @@ -14,6 +14,6 @@ [frontends.frontend{{.ID | replace "/" "-"}}] backend = "backend{{.ID | replace "/" "-"}}" [frontends.frontend-{{getHost . | replace "/" "-"}}.routes.route-host-{{getHost . | replace "/" "-"}}] - category = "Host" + rule = "Host" value = "{{getHost . | replace "/" "-"}}.{{$.Domain}}" {{end}} \ No newline at end of file diff --git a/templates/configuration.tmpl b/templates/configuration.tmpl index 77f50dec0..ff71ed6d7 100644 --- a/templates/configuration.tmpl +++ b/templates/configuration.tmpl @@ -39,13 +39,13 @@ - + {{range $keyRoutes, $valueRoutes := $valueFrontends.Routes}} - + {{end}} diff --git a/traefik.go b/traefik.go index db4472eac..5fa0b7100 100644 --- a/traefik.go +++ b/traefik.go @@ -188,7 +188,7 @@ func LoadConfig(configuration *Configuration, gloablConfiguration *GlobalConfigu newRoute := router.NewRoute() for routeName, route := range frontend.Routes { log.Debug("Creating route %s", routeName) - newRouteReflect := Invoke(newRoute, route.Category, route.Value) + newRouteReflect := Invoke(newRoute, route.Rule, route.Value) newRoute = newRouteReflect[0].Interface().(*mux.Route) } if backends[frontend.Backend] == nil { diff --git a/traefik.sample.toml b/traefik.sample.toml index fd5766ddb..16adb1603 100644 --- a/traefik.sample.toml +++ b/traefik.sample.toml @@ -196,10 +196,10 @@ # [frontends.frontend1] # backend = "backend2" # [frontends.frontend1.routes.test_1] -# category = "Host" +# rule = "Host" # value = "test.localhost" # [frontends.frontend2] # backend = "backend1" # [frontends.frontend2.routes.test_2] -# category = "Path" +# rule = "Path" # value = "/test"
RouteCategoryRule Value
{{$keyRoutes}}{{$valueRoutes.Category}}{{$valueRoutes.Rule}} {{$valueRoutes.Value}}