mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 22:23:48 +03:00
httpcaddyfile: Warn if site address uses unspecified IP (close #4004)
This commit is contained in:
parent
55e49ff5c8
commit
c986110678
1 changed files with 8 additions and 0 deletions
|
@ -17,6 +17,7 @@ package httpcaddyfile
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
|
@ -471,6 +472,13 @@ func (st *ServerType) serversFromPairings(
|
||||||
|
|
||||||
hosts := sblock.hostsFromKeys(false)
|
hosts := sblock.hostsFromKeys(false)
|
||||||
|
|
||||||
|
// emit warnings if user put unspecified IP addresses; they probably want the bind directive
|
||||||
|
for _, h := range hosts {
|
||||||
|
if h == "0.0.0.0" || h == "::" {
|
||||||
|
log.Printf("[WARNING] Site block has unspecified IP address %s which only matches requests having that Host header; you probably want the 'bind' directive to configure the socket", h)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// tls: connection policies
|
// tls: connection policies
|
||||||
if cpVals, ok := sblock.pile["tls.connection_policy"]; ok {
|
if cpVals, ok := sblock.pile["tls.connection_policy"]; ok {
|
||||||
// tls connection policies
|
// tls connection policies
|
||||||
|
|
Loading…
Reference in a new issue