mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-01-06 20:15:50 +08:00
支持更多的分组全局设置功能
This commit is contained in:
@@ -74,6 +74,77 @@ func (this *ServerConfig) Init() error {
|
||||
this.ReverseProxyRef = this.Group.UDPReverseProxyRef
|
||||
this.ReverseProxy = this.Group.UDPReverseProxy
|
||||
}
|
||||
|
||||
// web
|
||||
if this.Group.Web != nil {
|
||||
if this.Web == nil {
|
||||
this.Web = this.Group.Web
|
||||
} else {
|
||||
var groupWeb = this.Group.Web
|
||||
|
||||
// root
|
||||
if groupWeb.Root != nil && groupWeb.Root.IsPrior {
|
||||
this.Web.Root = groupWeb.Root
|
||||
}
|
||||
|
||||
// waf
|
||||
if groupWeb.FirewallRef != nil && groupWeb.FirewallRef.IsPrior {
|
||||
this.Web.FirewallRef = groupWeb.FirewallRef
|
||||
this.Web.FirewallPolicy = groupWeb.FirewallPolicy
|
||||
}
|
||||
|
||||
// cache
|
||||
if groupWeb.Cache != nil && groupWeb.Cache.IsPrior {
|
||||
this.Web.Cache = groupWeb.Cache
|
||||
}
|
||||
|
||||
// charset
|
||||
if groupWeb.Charset != nil && groupWeb.Charset.IsPrior {
|
||||
this.Web.Charset = groupWeb.Charset
|
||||
}
|
||||
|
||||
// accessLog
|
||||
if groupWeb.AccessLogRef != nil && groupWeb.AccessLogRef.IsPrior {
|
||||
this.Web.AccessLogRef = groupWeb.AccessLogRef
|
||||
}
|
||||
|
||||
// stat
|
||||
if groupWeb.StatRef != nil && groupWeb.StatRef.IsPrior {
|
||||
this.Web.StatRef = groupWeb.StatRef
|
||||
}
|
||||
|
||||
// compression
|
||||
if groupWeb.Compression != nil && groupWeb.Compression.IsPrior {
|
||||
this.Web.Compression = groupWeb.Compression
|
||||
}
|
||||
|
||||
// headers
|
||||
if groupWeb.RequestHeaderPolicyRef != nil && groupWeb.RequestHeaderPolicyRef.IsPrior {
|
||||
this.Web.RequestHeaderPolicyRef = groupWeb.RequestHeaderPolicyRef
|
||||
this.Web.RequestHeaderPolicy = groupWeb.RequestHeaderPolicy
|
||||
}
|
||||
if groupWeb.ResponseHeaderPolicyRef != nil && groupWeb.ResponseHeaderPolicyRef.IsPrior {
|
||||
this.Web.ResponseHeaderPolicyRef = groupWeb.ResponseHeaderPolicyRef
|
||||
this.Web.ResponseHeaderPolicy = groupWeb.ResponseHeaderPolicy
|
||||
}
|
||||
|
||||
// websocket
|
||||
if groupWeb.WebsocketRef != nil && groupWeb.WebsocketRef.IsPrior {
|
||||
this.Web.WebsocketRef = groupWeb.WebsocketRef
|
||||
this.Web.Websocket = groupWeb.Websocket
|
||||
}
|
||||
|
||||
// webp
|
||||
if groupWeb.WebP != nil && groupWeb.WebP.IsPrior {
|
||||
this.Web.WebP = groupWeb.WebP
|
||||
}
|
||||
|
||||
// remote addr
|
||||
if groupWeb.RemoteAddr != nil && groupWeb.RemoteAddr.IsPrior {
|
||||
this.Web.RemoteAddr = groupWeb.RemoteAddr
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if this.HTTP != nil {
|
||||
|
||||
@@ -15,4 +15,6 @@ type ServerGroupConfig struct {
|
||||
TCPReverseProxy *ReverseProxyConfig `yaml:"tcpReverseProxy" json:"tcpReverseProxy"`
|
||||
UDPReverseProxyRef *ReverseProxyRef `yaml:"udpReverseProxyRef" json:"udpReverseProxyRef"`
|
||||
UDPReverseProxy *ReverseProxyConfig `yaml:"udpReverseProxy" json:"udpReverseProxy"`
|
||||
|
||||
Web *HTTPWebConfig `yaml:"web" json:"web"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user