server {
server_name yeonghoon.kim;
if ($http_user_agent ~* (AhrefsBot) ) {
return 403;
}.
.
.
.
}
AhrefsBot 차단 예시임. robots.txt에 수집해가지 말라고 했는데 계속 접근해서 적용함.
-적용 전 로그
54.36.150.17 - - [15/Nov/2019:17:18:54 +0900] "GET /bbs/board.php?bo_table=board&sop=and&sst=wr_datetime&sod=desc&sfl=&stx=&sca=domain&page=1 HTTP/2.0" 200 11823 "-" "Mozilla/5.0 (compatible; AhrefsBot/6.1; +http://ahrefs.com/robot/)" "-"
-적용 후 로그
54.36.148.11 - - [15/Nov/2019:17:39:55 +0900] "GET /robots.txt HTTP/1.1" 403 162 "-" "Mozilla/5.0 (compatible; AhrefsBot/6.1; +http://ahrefs.com/robot/)" "-"