Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 23:30 UTC
core: Replace admin server later in provisionContext (#7004)
Jimmy Lipham committed
May 8, 2025 at 12:52 UTC
051e73aefca4cc3d930e8b637d848deb5e100126
1 file changed
+8
-8
caddy.go
+8
-8
@@ -505,14 +505,6 @@ func provisionContext(newCfg *Config, replaceAdminServer bool) (Context, error)
505
return ctx, err
506
}
507
508
- // start the admin endpoint (and stop any prior one)
509
- if replaceAdminServer {
510
- err = replaceLocalAdminServer(newCfg, ctx)
511
- if err != nil {
512
- return ctx, fmt.Errorf("starting caddy administration endpoint: %v", err)
513
- }
514
- }
515
-
508
// create the new filesystem map
509
newCfg.fileSystems = &filesystems.FileSystemMap{}
510
@@ -544,6 +536,14 @@ func provisionContext(newCfg *Config, replaceAdminServer bool) (Context, error)
536
return ctx, err
537
}
538
539
+ // start the admin endpoint (and stop any prior one)
540
+ if replaceAdminServer {
541
+ err = replaceLocalAdminServer(newCfg, ctx)
542
+ if err != nil {
543
+ return ctx, fmt.Errorf("starting caddy administration endpoint: %v", err)
544
+ }
545
+ }
546
+
547
// Load and Provision each app and their submodules
548
err = func() error {
549
for appName := range newCfg.AppsRaw {