diff --git a/cmd/main.go b/cmd/main.go index e92e71f6e3b..2dfb8677f91 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -123,7 +123,11 @@ func loadConfig(configFile, adapterName string) ([]byte, string, error) { var cfgAdapter caddyconfig.Adapter var err error if configFile != "" { - config, err = ioutil.ReadFile(configFile) + if configFile == "-" { + config, err = ioutil.ReadAll(os.Stdin) + } else { + config, err = ioutil.ReadFile(configFile) + } if err != nil { return nil, "", fmt.Errorf("reading config file: %v", err) }