禁止指定UA及UA为空的访问

作者:大公子 时间:23-05-31 阅读数:95人阅读

#禁止指定UA及UA为空的访问

if ($http_user_agent ~* "FeedDemon|Indy Library|DotBot|Alexa Toolbar|mj12bot|Googlebot|PetalBot|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|Feedly|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|HttpClient|MJ12bot|heritrix|Bytespider|Ezooms|Googlebot|JikeSpider|SemrushBot|^$" ) {

     return 403;             

}


禁止指定UA及UA为空的访问