vi /etc/nginx/fastpanel2-includes/deny.conf
Sau đó thêm vào nội dung sau
##deny xmlrpc
location = /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
}
##deny bot
# case sensitive matching
if ($http_user_agent ~ (Bytespider|Amazonbot/0.1|MJ12bot/v1.4.8|MJ12bot/v1.4.4|SemrushBot/6~bl|SemrushBot/7~bl|SemrushBot-BM/1.0|DotBot/1.1|DotBot/1.2|MegaIndex.ru/2.0|AspiegelBot|PetalBot|BLEXBot/1.0|serpstatbot/2.1|proximic|Barkrowler/0.9|SeekportBot|YandexBot/3.0|Pinterestbot/1.0|DataForSeoBot/1.0|GrapeshotCrawler/2.0|curl/8.1.2|AhrefsBot/7.0|Barkrowler/0.9)) {
return 403;
}
Tiếp theo khởi động lại nginx
service nginx restart