16552: Nginx listens on all interfaces, not just loopback.
[arvados.git] / lib / boot / supervisor.go
index 9ed92cb1aa4b6b7200220167330ca8d4727d6b69..ddc17953d2363d020d6aa37332c97c36c5b48646 100644 (file)
@@ -247,13 +247,9 @@ func (super *Supervisor) runCluster() error {
        }
 
        if super.ListenHost == "" {
-               if urlhost := super.cluster.Services.Controller.ExternalURL.Host; urlhost != "" {
-                       if h, _, _ := net.SplitHostPort(urlhost); h != "" {
-                               super.ListenHost = h
-                       } else {
-                               super.ListenHost = urlhost
-                       }
-               } else {
+               u := url.URL(super.cluster.Services.Controller.ExternalURL)
+               super.ListenHost = u.Hostname()
+               if super.ListenHost == "" {
                        super.ListenHost = "0.0.0.0"
                }
        }