userAgent is as follows:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4 ) AppleWebKit/537.36\ (KHTML, like Gecko ) \x09\x09\x09Chrome/55.0.2883.95
Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html\xA3\xA9
try to block in nginx, the code is as follows:
if ($http_user_agent ~ "Mozilla/5.0\ \(compatible;\ Baiduspider/2.0;\ +http://www.baidu.com/search/spider.html\\\xA3\\\xA9") {
return 403;
}
found no effect, how to block this kind of userAgent, or how to deal with characters like xA3xA9 x09? Thank you