Fix restart on USR1 not loading new Caddyfile

This commit is contained in:
Benny Ng
2016-06-08 13:04:37 +08:00
parent 6492592b4a
commit ff82057131
2 changed files with 16 additions and 30 deletions

View File

@@ -51,7 +51,8 @@ var contexts []*httpContext
func newContext() caddy.Context {
context := &httpContext{keysToSiteConfigs: make(map[string]*SiteConfig)}
contexts = append(contexts, context)
// put the new context at start to allow setup of directives on new instance
contexts = append([]*httpContext{context}, contexts...)
return context
}