Allow config to disable geoip (#2202)

For a offline or private cloud environment, geoip is not needed.
Implementing https://github.com/kubernetes/ingress-nginx/issues/2179
This commit is contained in:
Oilbeater 2018-03-19 00:30:05 +08:00 committed by Manuel Alejandro de Brito Fontes
parent c90a4e811e
commit 5c02d700cb
4 changed files with 15 additions and 2 deletions

View file

@ -81,6 +81,7 @@ http {
set_real_ip_from {{ $trusted_ip }};
{{ end }}
{{ if $cfg.UseGeoIP }}
{{/* databases used to determine the country depending on the client IP address */}}
{{/* http://nginx.org/en/docs/http/ngx_http_geoip_module.html */}}
{{/* this is require to calculate traffic for individual country using GeoIP in the status page */}}
@ -88,6 +89,7 @@ http {
geoip_city /etc/nginx/geoip/GeoLiteCity.dat;
geoip_org /etc/nginx/geoip/GeoIPASNum.dat;
geoip_proxy_recursive on;
{{ end }}
{{ if $cfg.EnableVtsStatus }}
vhost_traffic_status_zone shared:vhost_traffic_status:{{ $cfg.VtsStatusZoneSize }};