Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with SSL only in nginx #238

Merged
merged 2 commits into from
Jul 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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