Allow custom nginx templates
This commit is contained in:
parent
996c769080
commit
b086a686dd
5 changed files with 78 additions and 2 deletions
|
|
@ -29,6 +29,7 @@ import (
|
|||
|
||||
var (
|
||||
camelRegexp = regexp.MustCompile("[0-9A-Za-z]+")
|
||||
tmplPath = "/etc/nginx/template/nginx.tmpl"
|
||||
|
||||
funcMap = template.FuncMap{
|
||||
"empty": func(input interface{}) bool {
|
||||
|
|
@ -43,7 +44,7 @@ var (
|
|||
)
|
||||
|
||||
func (ngx *Manager) loadTemplate() {
|
||||
tmpl, _ := template.New("nginx.tmpl").Funcs(funcMap).ParseFiles("./nginx.tmpl")
|
||||
tmpl, _ := template.New("nginx.tmpl").Funcs(funcMap).ParseFiles(tmplPath)
|
||||
ngx.template = tmpl
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue