将以下代码插入到 server 域中

1
2
3
4
5
6
if ($http_user_agent ~*
"qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo!
Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web
spider|MSNBot|ia_archiver|Tomato Bot") {
return 403;
}