summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/caddyhttp.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/caddyhttp.go')
-rw-r--r--modules/caddyhttp/caddyhttp.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/caddyhttp/caddyhttp.go b/modules/caddyhttp/caddyhttp.go
index 009e564..68568a9 100644
--- a/modules/caddyhttp/caddyhttp.go
+++ b/modules/caddyhttp/caddyhttp.go
@@ -265,7 +265,12 @@ func (app *App) automaticHTTPS() error {
if err != nil {
return fmt.Errorf("%s: invalid listener address: %v", srvName, addr)
}
- httpRedirLnAddr := joinListenAddr(netw, host, strconv.Itoa(app.HTTPPort))
+
+ httpPort := app.HTTPPort
+ if httpPort == 0 {
+ httpPort = DefaultHTTPPort
+ }
+ httpRedirLnAddr := joinListenAddr(netw, host, strconv.Itoa(httpPort))
lnAddrMap[httpRedirLnAddr] = struct{}{}
if parts := strings.SplitN(port, "-", 2); len(parts) == 2 {