mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	集群服务设置增加“记录找不到网站日志”选项
This commit is contained in:
		@@ -226,14 +226,21 @@ func (this *HTTPListener) emptyServer() *serverconfigs.ServerConfig {
 | 
				
			|||||||
		Type: serverconfigs.ServerTypeHTTPProxy,
 | 
							Type: serverconfigs.ServerTypeHTTPProxy,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var accessLogRef = serverconfigs.NewHTTPAccessLogRef()
 | 
						// 检查是否开启访问日志
 | 
				
			||||||
	// TODO 需要配置是否记录日志
 | 
						if sharedNodeConfig != nil {
 | 
				
			||||||
	accessLogRef.IsOn = true
 | 
							var globalServerConfig = sharedNodeConfig.GlobalServerConfig
 | 
				
			||||||
	accessLogRef.Fields = append([]int{}, serverconfigs.HTTPAccessLogDefaultFieldsCodes...)
 | 
							if globalServerConfig != nil && globalServerConfig.HTTPAccessLog.EnableServerNotFound {
 | 
				
			||||||
	server.Web = &serverconfigs.HTTPWebConfig{
 | 
								var accessLogRef = serverconfigs.NewHTTPAccessLogRef()
 | 
				
			||||||
		IsOn:         true,
 | 
								accessLogRef.IsOn = true
 | 
				
			||||||
		AccessLogRef: accessLogRef,
 | 
								accessLogRef.Fields = append([]int{}, serverconfigs.HTTPAccessLogDefaultFieldsCodes...)
 | 
				
			||||||
 | 
								server.Web = &serverconfigs.HTTPWebConfig{
 | 
				
			||||||
 | 
									IsOn:         true,
 | 
				
			||||||
 | 
									AccessLogRef: accessLogRef,
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// TODO 需要对访问频率过多的IP进行惩罚
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return server
 | 
						return server
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user