최대한 간단하게 설치해서 최대한 적절히 사용해 봅시다.
geoip 모듈 설치
apt install libnginx-mod-http-geoip
사용 법은 아래 링크 확인하시기 바랍니다.
https://nginx.org/en/docs/http/ngx_http_geoip_module.html
Module ngx_http_geoip_module
Module ngx_http_geoip_module The ngx_http_geoip_module module (0.8.6+) creates variables with values depending on the client IP address, using the precompiled MaxMind databases. When using the databases with IPv6 support (1.3.12, 1.2.7), IPv4 addresses are
nginx.org
GeoIP DATA 설치
mkdir /usr/share/GeoIP
cd /usr/share/GeoIP
wget https://centminmod.com/centminmodparts/geoip-legacy/GeoIP.dat.gz
gunzip GeoIP.dat.gz
설치 방법에 따라 다르겠지만 우선 apt package 로 설치 하셨다면 아래와 같이 확인 가능 합니다.
nginx:/etc/nginx/modules-enabled# ll
total 16
drwxr-xr-x 2 root root 4096 Nov 17 12:53 ./
drwxr-xr-x 9 root root 4096 Nov 17 13:00 ../
lrwxrwxrwx 1 root root 54 Nov 17 12:53 50-mod-http-geoip.conf -> /usr/share/nginx/modules-available/mod-http-geoip.conf
lrwxrwxrwx 1 root root 61 Nov 11 06:19 50-mod-http-image-filter.conf -> /usr/share/nginx/modules-available/mod-http-image-filter.conf
lrwxrwxrwx 1 root root 60 Nov 11 06:19 50-mod-http-xslt-filter.conf -> /usr/share/nginx/modules-available/mod-http-xslt-filter.conf
lrwxrwxrwx 1 root root 48 Nov 11 06:19 50-mod-mail.conf -> /usr/share/nginx/modules-available/mod-mail.conf
lrwxrwxrwx 1 root root 50 Nov 11 06:19 50-mod-stream.conf -> /usr/share/nginx/modules-available/mod-stream.conf
'서버인프라 > 엔진엑스' 카테고리의 다른 글
Nginx 503 처리방법 (2) | 2023.03.13 |
---|---|
NGINX more_set_headers를 설치 (2) | 2022.11.30 |
사설 ssl인증서 적용 (0) | 2022.10.17 |
[ 제5강 캐싱 ] NGINX 콘텐츠 캐싱 (0) | 2021.01.22 |
[ 제4강 TCP&UDP부하 분산 ] NGINX 로드 벨런서 (0) | 2021.01.22 |
댓글