Saturday, August 17, 2019

Using dynamic GeoIP module with nginx (CentOS)

by / Wednesday, 13 April 2016 / Published in Linux, BSD, Unix

nginx introduced dynamic module support in v. 1.9.11. This brief article provides step-by-step procedure to enable GeoIP support on your CentOS server.

  1. Make sure you have EPEL and nginx-mainline repositories are added and enabled in your system (*)
  2. Execute yum install nginx-module-geoip command
  3. put this line on the top of your /etc/nginx/nginx.conf:load_module "modules/";
  4. test your configuration with nginx -t command
  5. If no errors happen, reload nginx with nginx -s reload

 That's it! You can immediately use the GeoIP module within nginx on your CentOS server.

(*) To use nginx-mainline repo, put the following to /etc/yum.repos.d/nginx.repo:

[nginx]name=nginx repo

Note that we have gpgcheck=1 (official docs suggest we use gpgcheck=0, but that seems to be incorrect).

It is possible that you will have to update your packages to get the latest nginx release.

(*) If you don not have EPEL yet, you can enable it with yum install epel-release

Read 4613 times Last modified on Wednesday, 13 April 2016 13:58

Do you like this? Please share!

Simon Tushev

Simon is IT professional with interests in web design, electronics, photography and astronomy. He writes about PHP, Yii, Joomla!, Arduino and several other topics.


Here I publish articles related to my areas of interest, my brief notes that may save some time to others, as well as some of my works.

This site is a work in progress. I will add more sections in the future, such as

  • More photos to photogallery
  • More Joomla!-related articles
  • ...



New Posts

Spam/Forgery Notice

If you've received a spam email from, please know that this emails are...

07-03-2019 in Blog


Using dynamic GeoIP module with nginx (CentOS)

nginx introduced dynamic module support in v. 1.9.11. This brief article provides step-by-step procedure...

13-04-2016 in Linux, BSD, Unix


Visual difference between pseudo and true random data

This is is "random" image generated using PHP rand() function: And this is an image...

20-11-2015 in Blog

Scroll to top

We use cookies, just to track visits to our website, we store no personal details Privacy policy