summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2020-02-27 21:04:06 -0700
committerMatthew Holt <[email protected]>2020-02-27 21:04:28 -0700
commit03ab55b51afeb99d99f312c866ab3effeb7e180c (patch)
treeb34265ffdd1a60c69c4d8e9a4019ba94e1d09a6e
parentcef6e098bb278d50cb2f45f57ed40b3af47d6a74 (diff)
downloadcaddy-03ab55b51afeb99d99f312c866ab3effeb7e180c.tar.gz
caddy-03ab55b51afeb99d99f312c866ab3effeb7e180c.zip
httpcaddyfile: Allow "admin off" option
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go
index cfb3121ca..8c10a53c6 100644
--- a/caddyconfig/httpcaddyfile/httptype.go
+++ b/caddyconfig/httpcaddyfile/httptype.go
@@ -327,7 +327,11 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock,
&warnings)
}
if adminConfig, ok := options["admin"].(string); ok && adminConfig != "" {
- cfg.Admin = &caddy.AdminConfig{Listen: adminConfig}
+ if adminConfig == "off" {
+ cfg.Admin = &caddy.AdminConfig{Disabled: true}
+ } else {
+ cfg.Admin = &caddy.AdminConfig{Listen: adminConfig}
+ }
}
if len(customLogs) > 0 {
if cfg.Logging == nil {