diff --git a/caddyhttp/httpserver/plugin.go b/caddyhttp/httpserver/plugin.go index c1bd6a57..9401f222 100644 --- a/caddyhttp/httpserver/plugin.go +++ b/caddyhttp/httpserver/plugin.go @@ -55,6 +55,12 @@ func init() { func hideCaddyfile(cctx caddy.Context) error { ctx := cctx.(*httpContext) for _, cfg := range ctx.siteConfigs { + + // if no Caddyfile exists exit. + if cfg.originCaddyfile == "" { + return nil + } + absRoot, err := filepath.Abs(cfg.Root) if err != nil { return err