master
fangdingjun 8 years ago
parent 401596145d
commit 3497536f19

@ -11,7 +11,7 @@ type server struct {
Host string Host string
Port int Port int
Docroot string Docroot string
UrlRules []rule URLRules []rule
EnableProxy bool EnableProxy bool
Vhost []vhost Vhost []vhost
} }
@ -21,7 +21,7 @@ type vhost struct {
Hostname string Hostname string
Cert string Cert string
Key string Key string
UrlRules []rule URLRules []rule
} }
type rule struct { type rule struct {

@ -36,7 +36,7 @@ func initRouters(cfg conf) {
} }
} }
r := router.Host(h2).Subrouter() r := router.Host(h2).Subrouter()
for _, rule := range h.UrlRules { for _, rule := range h.URLRules {
switch rule.Type { switch rule.Type {
case "alias": case "alias":
registerAliasHandler(rule, r) registerAliasHandler(rule, r)
@ -54,7 +54,7 @@ func initRouters(cfg conf) {
} }
// default host config // default host config
for _, rule := range l.UrlRules { for _, rule := range l.URLRules {
switch rule.Type { switch rule.Type {
case "alias": case "alias":
registerAliasHandler(rule, router) registerAliasHandler(rule, router)

Loading…
Cancel
Save