macsplex.com 로그인

검색

nginx
2021.03.22 23:03

nginx semrush bot 차단

조회 수 438 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 게시글 수정 내역 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 게시글 수정 내역 댓글로 가기 인쇄
Extra Form

/etc/nginx/sites-available/도메인 파일의 Server 해당 라인을 추가


### UserAgent block
        if ($http_user_agent = "") {
        return 403;
        }
        if ($http_user_agent ~* (AhrefsBot|BLEXBot|DotBot|SemrushBot|Eyeotabot|PetalBot|MJ12bot|brands-bot|bbot|AhrefsBo|MegaIndex|UCBrowser|Mb2345Browser|MicroMessenger|LieBaoFast|Headless|netEstate|newspaper|Adsbot/3.1|WordPress/|ltx71) ) {
    return 403;
  }


nginx재시작해줍니다.

debian ex) # /etc/init.d/nginx restart


curl를 사용하여 해당봇의 응답을 확인하는 명령어

#  curl -l --User-Agent "Mozilla/5.0 (compatible; SemrushBot; +http://www.semrush.com/bot.html)" https://macsplex.com


<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.10.3</center>
</body>
</html>



403 Forbidden 나오면 차단된걸로 확인하면 됩니다.






--------------------------------------------------광고(Advertising)-------------------------------------------------------------------------------------


TAG •

리눅스 Tip

Linux Tip

  1. VMware Remote-Console 설치 에러

    CategoryFedora
    Read More
  2. sudo 유저추가

    CategoryFedora
    Read More
  3. yarn 설치방법

    CategoryFedora
    Read More
  4. 우분투 18.04 영문판에서 한글입력 추가

    CategoryUbuntu
    Read More
  5. CentOS 8 웹콘솔(Cokpit) 설치하기

    CategoryCentOS
    Read More
  6. nginx "rewrite" directive is not allowed here in 에러발생시

    CategoryDebian
    Read More
  7. 워드프레스 고유주소 nginx 설정

    CategoryDebian
    Read More
  8. 웹로그분석툴 GoAccess

    CategoryDebian
    Read More
  9. Ngnix 특정폴더 인증절차추가

    CategoryDebian
    Read More
  10. nginx semrush bot 차단

    Categorynginx
    Read More
  11. nginx rewrite 예제

    Categorynginx
    Read More
Board Pagination Prev 1 ... 3 4 5 6 7 8 Next
/ 8