mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-26 02:09:47 +08:00
Log if host is not configured for server
This commit is contained in:
parent
77eae62d9f
commit
8a6c778c8d
|
@ -113,9 +113,6 @@ func MarkQualified(configs []server.Config) {
|
|||
// ObtainCerts obtains certificates for all these configs as long as a certificate does not
|
||||
// already exist on disk. It does not modify the configs at all; it only obtains and stores
|
||||
// certificates and keys to the disk.
|
||||
//
|
||||
// TODO: Right now by potentially prompting about ToS error, we assume this function is only
|
||||
// called at startup, but that is not always the case because it could be during a restart.
|
||||
func ObtainCerts(configs []server.Config, altPort string) error {
|
||||
groupedConfigs := groupConfigsByEmail(configs, altPort != "") // don't prompt user if server already running
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"crypto/x509"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -346,6 +347,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
} else {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
fmt.Fprintf(w, "No such host at %s", s.Server.Addr)
|
||||
log.Printf("[INFO] %s - No such host at %s", host, s.Server.Addr)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user