Allow custom nginx templates

This commit is contained in:
Manuel de Brito Fontes 2016-04-30 12:34:33 -03:00
parent 996c769080
commit b086a686dd
5 changed files with 78 additions and 2 deletions

View file

@ -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
}