주 메뉴 열기

wwiki β

바뀜

Nginx

493 바이트 추가됨, 2020년 9월 26일 (토) 01:04
해외아이피 차단
nginx geo ip 모듈 설치 확인: --with-http_geoip_module=dynamic
$ /usr/sbin/nginx -V
geoip 데이터베이스 패키지 설치 $ sudo apt install geoip-database설정파일에 국가 추가하기: /etc/nginx/nginx.conf<syntaxhighlight lang="nginx"> #특정국가 IP 차단하기 geoip_country /usr/share/GeoIP/GeoIP.dat; map $geoip_country_code $allowed_country { default yes; RU no; CN no; }</syntaxhighlight>server블록에 추가<syntaxhighlight lang="nginx">if ($allowed_country = no) { return 444;}</syntaxhighlight><br />
==에러==
편집
2,431