diff --git a/src/mod/dynamicproxy/proxyRequestHandler.go b/src/mod/dynamicproxy/proxyRequestHandler.go
index dba00bd..24dbfc2 100644
--- a/src/mod/dynamicproxy/proxyRequestHandler.go
+++ b/src/mod/dynamicproxy/proxyRequestHandler.go
@@ -361,7 +361,7 @@ func (router *Router) logRequest(r *http.Request, succ bool, statusCode int, for
// in that case we will log it by default and will not enter this routine
return
}
- if router.Option.StatisticCollector != nil {
+ if router.Option.StatisticCollector != nil && !endpoint.DisableStatisticCollection {
go func() {
requestInfo := statistic.RequestInfo{
IpAddr: netutils.GetRequesterIP(r),
@@ -377,6 +377,7 @@ func (router *Router) logRequest(r *http.Request, succ bool, statusCode int, for
}
router.Option.StatisticCollector.RecordRequest(requestInfo)
}()
+
}
router.Option.Logger.LogHTTPRequest(r, forwardType, statusCode, originalHostname, upstreamHostname)
}
diff --git a/src/mod/dynamicproxy/typedef.go b/src/mod/dynamicproxy/typedef.go
index 414b6d7..d207a86 100644
--- a/src/mod/dynamicproxy/typedef.go
+++ b/src/mod/dynamicproxy/typedef.go
@@ -207,8 +207,9 @@ type ProxyEndpoint struct {
RateLimit int64 // Rate limit in requests per second
//Uptime Monitor
- DisableUptimeMonitor bool //Disable uptime monitor for this endpoint
- DisableLogging bool //Disable logging of reverse proxy requests
+ DisableUptimeMonitor bool //Disable uptime monitor for this endpoint
+ DisableLogging bool //Disable logging of reverse proxy requests
+ DisableStatisticCollection bool //Disable statistic collection for this endpoint
// Chunked Transfer Encoding
DisableChunkedTransferEncoding bool //Disable chunked transfer encoding for this endpoint
diff --git a/src/reverseproxy.go b/src/reverseproxy.go
index 652ae66..8e9cf77 100644
--- a/src/reverseproxy.go
+++ b/src/reverseproxy.go
@@ -577,6 +577,9 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) {
// Disable logging
disableLogging, _ := utils.PostBool(r, "dLogging")
+ // Disable statistic collection
+ disableStatisticCollection, _ := utils.PostBool(r, "dStatisticCollection")
+
//Load the previous basic auth credentials from current proxy rules
targetProxyEntry, err := dynamicProxyRouter.LoadProxy(rootNameOrMatchingDomain)
if err != nil {
@@ -619,6 +622,7 @@ func ReverseProxyHandleEditEndpoint(w http.ResponseWriter, r *http.Request) {
newProxyEndpoint.DisableUptimeMonitor = disbleUtm
newProxyEndpoint.DisableChunkedTransferEncoding = disableChunkedEncoding
newProxyEndpoint.DisableLogging = disableLogging
+ newProxyEndpoint.DisableStatisticCollection = disableStatisticCollection
newProxyEndpoint.Tags = tags
//Prepare to replace the current routing rule
diff --git a/src/web/components/httprp.html b/src/web/components/httprp.html
index 15de241..0e3e3d3 100644
--- a/src/web/components/httprp.html
+++ b/src/web/components/httprp.html
@@ -290,6 +290,13 @@
+
+