Skip to content

Commit

Permalink
Merge pull request #238 from ehazlett/nginx-ssl-template-fix
Browse files Browse the repository at this point in the history
Fix issue with SSL only in nginx
  • Loading branch information
ehazlett authored Jul 31, 2017
2 parents 3e832e8 + 5f817fe commit f6ccc1f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ext/lb/nginx/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ http {
stub_status on;
access_log off;
}
{{ end }}
}
{{ if $host.SSL }}
server {
listen {{ $host.SSLPort }};
Expand Down Expand Up @@ -155,6 +155,8 @@ http {
{{ end }}
{{ end }} {{/* end host range */}}
}
include {{ .Config.ConfigBasePath }}/conf.d/*.conf;
}
`
3 changes: 2 additions & 1 deletion ext/lb/nginx/template_nginxplus.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ http {
stub_status on;
access_log off;
}
{{ end }}
}
{{ if $host.SSL }}
Expand Down Expand Up @@ -168,6 +167,8 @@ http {
{{ end }}
{{ end }} {{/* end host range */}}
}
include {{ .Config.ConfigBasePath }}/conf.d/*.conf;
}
`
5 changes: 5 additions & 0 deletions ext/lb/utils/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,17 @@ func BackendAddress(cnt types.Container, backendOverrideAddress string) (string,
}
for _, port := range ports {
if port.PrivatePort == uint16(interlockPort) {
portDef.HostIP = port.IP
portDef.HostPort = fmt.Sprintf("%d", port.PublicPort)
break
}
}
}

if portDef.HostIP == "" || portDef.HostPort == "" {
return "", fmt.Errorf("unable to find ip or exposed port: %+v", portDef)
}

addr = fmt.Sprintf("%s:%s", portDef.HostIP, portDef.HostPort)
return addr, nil
}
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package version

var (
Version = "1.4.1"
Version = "1.4.2"

// Build will be overwritten automatically by the build system
Build = "-dev"
Expand Down

0 comments on commit f6ccc1f

Please sign in to comment.