diff --git a/ext/lb/nginx/template.go b/ext/lb/nginx/template.go index aff276cf..903e5f20 100644 --- a/ext/lb/nginx/template.go +++ b/ext/lb/nginx/template.go @@ -121,9 +121,9 @@ http { stub_status on; access_log off; } - {{ end }} } + {{ if $host.SSL }} server { listen {{ $host.SSLPort }}; @@ -155,6 +155,8 @@ http { {{ end }} {{ end }} {{/* end host range */}} + } + include {{ .Config.ConfigBasePath }}/conf.d/*.conf; } ` diff --git a/ext/lb/nginx/template_nginxplus.go b/ext/lb/nginx/template_nginxplus.go index fd400404..1e6c859c 100644 --- a/ext/lb/nginx/template_nginxplus.go +++ b/ext/lb/nginx/template_nginxplus.go @@ -134,7 +134,6 @@ http { stub_status on; access_log off; } - {{ end }} } {{ if $host.SSL }} @@ -168,6 +167,8 @@ http { {{ end }} {{ end }} {{/* end host range */}} + } + include {{ .Config.ConfigBasePath }}/conf.d/*.conf; } ` diff --git a/ext/lb/utils/network.go b/ext/lb/utils/network.go index ad0aecc4..925fdb58 100644 --- a/ext/lb/utils/network.go +++ b/ext/lb/utils/network.go @@ -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 } diff --git a/version/version.go b/version/version.go index 2be598ec..4014dd93 100644 --- a/version/version.go +++ b/version/version.go @@ -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"