Welcome to Centmin Mod Community
Become a Member

Nginx How to disable GeoIP Module in Nginx 1.9.11+

Discussion in 'Nginx and PHP-FPM news & discussions' started by negative, Mar 4, 2016.

Tags:
  1. negative

    negative Member

    212
    20
    18
    Apr 11, 2015
    Ratings:
    +48
    Local Time:
    10:25 PM
    1.9.10
    10.1.11
    Latest nginx versions supports the dynamic modules and i don't use the geoIP module so i want to clear the unnecessary modules from my server.

    dynamic-modules.conf includes these lines;
    Code:
    load_module "modules/ngx_http_image_filter_module.so";
    load_module "modules/ngx_http_geoip_module.so";
    load_module "modules/ngx_stream_module.so";
    If i comment the geoip line, it will be disabled or do i need re-compile nginx with disabling the geoIP?

    Code:
    #load_module "modules/ngx_http_geoip_module.so";
    What is the way ? Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:25 AM
    Nginx 1.13.x
    MariaDB 5.5
    yes you can unload dynamic modules that way

    but geoip is used in geoip.conf include otherwise
    Code (Text):
     nginx -t
    nginx: [emerg] unknown directive "geoip_country" in /usr/local/nginx/conf/geoip.conf:2
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
     
    Last edited: Mar 4, 2016