diff --git a/controllers/nginx/pkg/config/config.go b/controllers/nginx/pkg/config/config.go index 68d6af068..d4121e35b 100644 --- a/controllers/nginx/pkg/config/config.go +++ b/controllers/nginx/pkg/config/config.go @@ -422,6 +422,7 @@ func NewDefault() Configuration { WorkerShutdownTimeout: "10s", LoadBalanceAlgorithm: defaultLoadBalancerAlgorithm, VtsStatusZoneSize: "10m", + VtsDefaultFilterKey: "$geoip_country_code country::*", VariablesHashBucketSize: 64, VariablesHashMaxSize: 2048, UseHTTP2: true, diff --git a/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl b/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl index a878d2c5c..cfa721acd 100644 --- a/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl +++ b/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl @@ -46,7 +46,7 @@ http { {{ if $cfg.EnableVtsStatus }} vhost_traffic_status_zone shared:vhost_traffic_status:{{ $cfg.VtsStatusZoneSize }}; - vhost_traffic_status_filter_by_set_key {{ if not $cfg.VtsDefaultFilterKey }}$geoip_country_code country::*{{ else }} {{ $cfg.VtsDefaultFilterKey }}{{ end }}; + vhost_traffic_status_filter_by_set_key {{ $cfg.VtsDefaultFilterKey }}; {{ end }} sendfile on;