summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/main.go b/cmd/main.go
index d8e5f7b..54d11d8 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -137,7 +137,9 @@ func loadConfig(configFile, adapterName string) ([]byte, error) {
// as a special case, if a config file called "Caddyfile" was
// specified, and no adapter is specified, assume caddyfile adapter
// for convenience
- if filepath.Base(configFile) == "Caddyfile" && adapterName == "" {
+ if strings.HasPrefix(filepath.Base(configFile), "Caddyfile") &&
+ filepath.Ext(configFile) != ".json" &&
+ adapterName == "" {
adapterName = "caddyfile"
}