diff --git a/provider/docker/service_test.go b/provider/docker/service_test.go index 334202117..6198921f3 100644 --- a/provider/docker/service_test.go +++ b/provider/docker/service_test.go @@ -356,7 +356,7 @@ func TestDockerLoadDockerServiceConfig(t *testing.T) { expectedBackends: map[string]*types.Backend{ "backend-foo-service": { Servers: map[string]types.Server{ - "service": { + "service-0": { URL: "http://127.0.0.1:2503", Weight: 0, }, @@ -426,7 +426,7 @@ func TestDockerLoadDockerServiceConfig(t *testing.T) { expectedBackends: map[string]*types.Backend{ "backend-foobar": { Servers: map[string]types.Server{ - "service": { + "service-0": { URL: "https://127.0.0.1:2503", Weight: 80, }, @@ -435,7 +435,7 @@ func TestDockerLoadDockerServiceConfig(t *testing.T) { }, "backend-test2-anotherservice": { Servers: map[string]types.Server{ - "service": { + "service-0": { URL: "http://127.0.0.1:8079", Weight: 33, }, diff --git a/templates/docker.tmpl b/templates/docker.tmpl index c2a7cf54b..2004407f5 100644 --- a/templates/docker.tmpl +++ b/templates/docker.tmpl @@ -26,7 +26,7 @@ {{if hasServices $server}} {{$services := getServiceNames $server}} {{range $serviceIndex, $serviceName := $services}} - [backends.backend-{{getServiceBackend $server $serviceName}}.servers.service] + [backends.backend-{{getServiceBackend $server $serviceName}}.servers.service-{{$serverName}}] url = "{{getServiceProtocol $server $serviceName}}://{{getIPAddress $server}}:{{getServicePort $server $serviceName}}" weight = {{getServiceWeight $server $serviceName}} {{end}}