Revert geoip2 changes

merge-requests/341/head v1.4.1
Thomas Lynch 5 months ago
parent bde2f25a42
commit 9c2812bcea
Signed by: fatchan
GPG Key ID: A7E5E8B7E11EE92D
  1. 8
      configs/nginx/nginx.sh

@ -282,14 +282,10 @@ if [ "$GEOIP" == "y" ]; then
wget --retry-connrefused -qO- "https://download.db-ip.com/free/dbip-country-lite-`date +%Y-%m`.mmdb.gz" | tee "/usr/share/GeoIP/dbip.mmdb.gz" >/dev/null
gunzip "/usr/share/GeoIP/dbip.mmdb.gz"
#add goeip_country to /etc/nginx/nginx.conf, only if not already exists
grep -qF "geoip2" /etc/nginx/nginx.conf
grep -qF "geoip_country" /etc/nginx/nginx.conf
if [ $? -eq 1 ]; then
sudo sed -i '/http {/a \
geoip2 /usr/share/GeoIP/dbip.mmdb {\
auto_reload 5m;\
$geoip2_data_country_code default=unknown source=$remote_addr country iso_code;\
$geoip2_data_country_name country names en;\
}' /etc/nginx/nginx.conf
geoip_country /usr/share/GeoIP/geoip.mmdb;' /etc/nginx/nginx.conf
fi
else
echo "Geoip not installed, removing directives..."

Loading…
Cancel
Save