diff --git a/caddyhttp/httpserver/plugin.go b/caddyhttp/httpserver/plugin.go index c1bd6a570..9faf5ac33 100644 --- a/caddyhttp/httpserver/plugin.go +++ b/caddyhttp/httpserver/plugin.go @@ -55,6 +55,10 @@ 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