verrary

User agent block Nginx

Dec 2nd, 2014
407
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. User agent block Nginx
  2.  
  3. touch /etc/nginx/sites-available/BlockUA
  4. ln -s /etc/nginx/sites-available/BlockUA /etc/nginx/sites-enabled
  5. nano /etc/nginx/sites-available/BlockUA
  6.  
  7. server {
  8. if ($http_user_agent ~* "AhrefsBot|Ahrefs|rogerbot|MJ12bot|majestic12|MJ12|SiteBot|Semrush|SiteExplorer|Crawler|WebTarantula|Lipperhey SEO|BLEXBot|SEOkicks-Robot|linkdexbot|SEOprofilerBot|Blekkobot|exabot|dotbot|BCKLINKS|InternetSeer.com|SEO Spider|aiHitBot|YisouSpider|CCBot|MojeekBot|80legs|SEOkicks-Robot|HTTPClient|Owlin Bot|mechanize|Web Crawler|com Crawler|CRAZYWEBCRAWLER|Elinks| Rankivabot|DBLBot|libw|Java|Voil|Twice|Sogou|psbot|Exabot|boitho|ajSitemap|Rankivabot|SeznamBot| DBLBot|Baiduspider|Windows 98|Ezooms|libwww-perl|Xenu|PleaseBot|Wget|ia_archiver|spbot|DigExt|archive|NerdyBot|RU_Bot|HTTPLib|Typhoeus|Scrapy|Sogou|Twingly| TweetmemeBot|magpie-crawler|Twisted|Spider|niki-bot|ITVdev|LoadTimeBot|R6_FeedFetcher|EC2|cURL|python|Wotbox|EasouSpider|SISTRIX|domainsbot|WinHTTP|AppEngine|meanpathbot|FeedBot|spyder|Webinspector|-Crawler|TurnitinBot|Nutch|trendictionbot|Prlog|TwengaBot|Ezooms/1.0|KomodiaBot|proximic|windows 98|Win98|Jakarta|XoviBot|Genieo|DomainTunoCrawler|gigabot|Twitterbot|Java"   )
  9. {return 403;}
  10. }
RAW Paste Data