Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngx_http_geoip2_module #1

Closed
aibosss opened this issue Dec 2, 2018 · 4 comments
Closed

ngx_http_geoip2_module #1

aibosss opened this issue Dec 2, 2018 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@aibosss
Copy link

aibosss commented Dec 2, 2018

I love your nginx-more :)

However, each updates, I have to go and recompile this module https://github.com/leev/ngx_http_geoip2_module with the new nginx version to be able to add it to your packages.

Would you mind adding it by default? I'm sure many people would benefit as it's required to play with MaxMind Geoip2 new formats

Thanks ! :)

@karljohns0n
Copy link
Owner

Hi,

This module depends on libmaxminddb so I would need to build this lib as well because I don't want to rely on other repository such as EPEL to install nginx-more. Let me see what I can do!

Karl

@aibosss
Copy link
Author

aibosss commented Dec 3, 2018 via email

@karljohns0n
Copy link
Owner

karljohns0n commented Jan 17, 2019

So I went ahead and built latest libmaxminddb-1.3.2 for el6 and el7. It's now in the testing repository. I built a new version of nginx-more based on this lib and module ngx_http_geoip2_module-3.2:

yum --enablerepo=aeris-testing install https://repo.aerisnetwork.com/archive/nginx-more-1.14.2-2.el7.x86_64.rpm
[root@devkarl etc]# nginx -V
nginx version: nginx/1.14.2
custom build maintained on github.com/karljohns0n/nginx-more
built by gcc 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC) 
built with OpenSSL 1.1.1a  20 Nov 2018
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/cache/client_body --http-proxy-temp-path=/var/lib/nginx/cache/proxy --http-fastcgi-temp-path=/var/lib/nginx/cache/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/cache/uwsgi --http-scgi-temp-path=/var/lib/nginx/cache/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --user=nginx --group=nginx --with-compat --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_image_filter_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_geoip_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-threads --with-stream --with-stream_ssl_module --with-stream_realip_module --with-http_slice_module --with-stream_ssl_preread_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DTCP_FASTOPEN=23' --with-cc=/opt/rh/devtoolset-7/root/usr/bin/gcc --with-openssl=modules/openssl-1.1.1a --add-module=modules/ngx_headers_more-0.33 --add-module=modules/ngx_cache_purge-2.3 --add-module=modules/ngx_module_vts-0.1.18 --add-module=modules/ngx_pagespeed-1.13.35.2-stable --add-module=modules/ngx_brotli-snap20180222 --add-module=modules/ngx_http_geoip2_module-3.2

I did some basic testing, showing my city & country name in headers:

geoip2 /etc/GeoLite2-Country.mmdb {
    auto_reload 5m;
    $geoip2_metadata_country_build metadata build_epoch;
    $geoip2_data_country_code default=US country iso_code;
    $geoip2_data_country_name country names en;
}

geoip2 /etc/GeoLite2-City.mmdb {
    auto_reload 5m;
    $geoip2_metadata_city_build metadata build_epoch;
    $geoip2_data_city_name default=Montreal city names en;
}

add_header X-Country $geoip2_data_country_name;
add_header X-City $geoip2_data_city_name;

Headers:

X-Country: Canada
X-City: Montreal

It works fine on my side. Can you provide feedbacks?

Karl

@karljohns0n karljohns0n self-assigned this Jan 17, 2019
@karljohns0n karljohns0n added the enhancement New feature or request label Jan 17, 2019
@karljohns0n
Copy link
Owner

karljohns0n commented Jan 22, 2019

Now released in the testing repository as of nginx-more-1.14.2-2, see commit 3a36521.

#> yum --enablerepo=aeris-testing update nginx-more

Repository owner deleted a comment from dvershinin May 15, 2019
tedwardia added a commit to tedwardia/nginx-more that referenced this issue Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants