diff --git a/src/models/server/config.go b/src/models/server/config.go index aa963dad..4d8b813a 100644 --- a/src/models/server/config.go +++ b/src/models/server/config.go @@ -301,6 +301,8 @@ func loadProxyConf(confFile string) (proxyServers map[string]*ProxyServer, err e locStr, loc_ok := section["custom_location"] if loc_ok { proxyServer.Locations = strings.Split(locStr, ",") + } else { + proxyServer.Locations = []string{""} } } else if proxyServer.Type == "https" { // for https diff --git a/src/utils/vhost/router.go b/src/utils/vhost/router.go index d4735df1..b245874a 100644 --- a/src/utils/vhost/router.go +++ b/src/utils/vhost/router.go @@ -91,8 +91,8 @@ func (r *VhostRouters) get(rname string) (vr *VhostRouter, exist bool) { url = tmparray[1] } - vrs, exist := r.RouterByDomain[domain] - if !exist { + vrs, found := r.RouterByDomain[domain] + if !found { return }