From 875c758ba2d25390eb8430fa5c143dc1250008d3 Mon Sep 17 00:00:00 2001 From: Marcel van der Boom Date: Mon, 26 Nov 2018 18:32:18 +0100 Subject: [PATCH] Also use bind address on standalone redirect --- app.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app.go b/app.go index 9019399..96c610b 100644 --- a/app.go +++ b/app.go @@ -409,11 +409,12 @@ func Serve() { bindAddress = "localhost" } if app.cfg.IsSecureStandalone() { - log.Info("Serving redirects on http://localhost:80") + log.Info("Serving redirects on http://%s:80", bindAddress) go func() { - err = http.ListenAndServe(":80", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, app.cfg.App.Host, http.StatusMovedPermanently) - })) + err = http.ListenAndServe( + fmt.Sprintf("%s:80", bindAddress), http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, app.cfg.App.Host, http.StatusMovedPermanently) + })) log.Error("Unable to start redirect server: %v", err) }()