@@ -172,6 +172,9 @@ http {
172
172
{{ range $index, $file := $all.MaxmindEditionFiles }}
173
173
{{ if eq $file "GeoLite2-Country.mmdb" }}
174
174
geoip2 /etc/ingress-controller/geoip/GeoLite2-Country.mmdb {
175
+ {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
176
+ auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
177
+ {{ end }}
175
178
$geoip2_country_code source=$remote_addr country iso_code;
176
179
$geoip2_country_name source=$remote_addr country names en;
177
180
$geoip2_country_geoname_id source=$remote_addr country geoname_id;
@@ -183,6 +186,9 @@ http {
183
186
184
187
{{ if eq $file "GeoIP2-Country.mmdb" }}
185
188
geoip2 /etc/ingress-controller/geoip/GeoIP2-Country.mmdb {
189
+ {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
190
+ auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
191
+ {{ end }}
186
192
$geoip2_country_code source=$remote_addr country iso_code;
187
193
$geoip2_country_name source=$remote_addr country names en;
188
194
$geoip2_country_geoname_id source=$remote_addr country geoname_id;
@@ -194,6 +200,9 @@ http {
194
200
195
201
{{ if eq $file "GeoLite2-City.mmdb" }}
196
202
geoip2 /etc/ingress-controller/geoip/GeoLite2-City.mmdb {
203
+ {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
204
+ auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
205
+ {{ end }}
197
206
$geoip2_city_country_code source=$remote_addr country iso_code;
198
207
$geoip2_city_country_name source=$remote_addr country names en;
199
208
$geoip2_city_country_geoname_id source=$remote_addr country geoname_id;
@@ -217,6 +226,9 @@ http {
217
226
218
227
{{ if eq $file "GeoIP2-City.mmdb" }}
219
228
geoip2 /etc/ingress-controller/geoip/GeoIP2-City.mmdb {
229
+ {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
230
+ auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
231
+ {{ end }}
220
232
$geoip2_city_country_code source=$remote_addr country iso_code;
221
233
$geoip2_city_country_name source=$remote_addr country names en;
222
234
$geoip2_city_country_geoname_id source=$remote_addr country geoname_id;
@@ -240,20 +252,29 @@ http {
240
252
241
253
{{ if eq $file "GeoLite2-ASN.mmdb" }}
242
254
geoip2 /etc/ingress-controller/geoip/GeoLite2-ASN.mmdb {
255
+ {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
256
+ auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
257
+ {{ end }}
243
258
$geoip2_asn source=$remote_addr autonomous_system_number;
244
259
$geoip2_org source=$remote_addr autonomous_system_organization;
245
260
}
246
261
{{ end }}
247
262
248
263
{{ if eq $file "GeoIP2-ASN.mmdb" }}
249
264
geoip2 /etc/ingress-controller/geoip/GeoIP2-ASN.mmdb {
265
+ {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
266
+ auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
267
+ {{ end }}
250
268
$geoip2_asn source=$remote_addr autonomous_system_number;
251
269
$geoip2_org source=$remote_addr autonomous_system_organization;
252
270
}
253
271
{{ end }}
254
272
255
273
{{ if eq $file "GeoIP2-ISP.mmdb" }}
256
274
geoip2 /etc/ingress-controller/geoip/GeoIP2-ISP.mmdb {
275
+ {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
276
+ auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
277
+ {{ end }}
257
278
$geoip2_isp source=$remote_addr isp;
258
279
$geoip2_isp_org source=$remote_addr organization;
259
280
$geoip2_asn source=$remote_addr default=0 autonomous_system_number;
@@ -268,6 +289,9 @@ http {
268
289
269
290
{{ if eq $file "GeoIP2-Anonymous-IP.mmdb" }}
270
291
geoip2 /etc/ingress-controller/geoip/GeoIP2-Anonymous-IP.mmdb {
292
+ {{ if (gt $cfg.GeoIP2AutoReloadMinutes 0) }}
293
+ auto_reload {{ $cfg.GeoIP2AutoReloadMinutes }}m;
294
+ {{ end }}
271
295
$geoip2_is_anon source=$remote_addr is_anonymous;
272
296
$geoip2_is_anonymous source=$remote_addr default=0 is_anonymous;
273
297
$geoip2_is_anonymous_vpn source=$remote_addr default=0 is_anonymous_vpn;
0 commit comments