diff --git a/caddy.go b/caddy.go index 917a5d06..2e323544 100644 --- a/caddy.go +++ b/caddy.go @@ -798,7 +798,7 @@ func startServers(serverList []Server, inst *Instance, restartFds map[string]res continue } if strings.Contains(err.Error(), "use of closed network connection") { - // this error is normal when closing the listener + // this error is normal when closing the listener; see https://github.com/golang/go/issues/4373 continue } log.Println(err) diff --git a/caddyhttp/httpserver/server.go b/caddyhttp/httpserver/server.go index 8028fce8..c3fbc669 100644 --- a/caddyhttp/httpserver/server.go +++ b/caddyhttp/httpserver/server.go @@ -319,6 +319,9 @@ func (s *Server) Serve(ln net.Listener) error { } err := s.Server.Serve(ln) + if err == http.ErrServerClosed { + err = nil // not an error worth reporting since closing a server is intentional + } if s.quicServer != nil { s.quicServer.Close() }