https://cloud.tencent.com/developer/article/1444870
server {
listen 80;
server_name www.test.com;
root /var/www/test;
index index.html index.htm;
location / {
}
# 定义错误页面码,如果出现相应的错误页面码,转发到那里。
error_page 404 403 500 502 503 504 /404.html;
# 承接上面的location。
location = /404.html {
# 放错误页面的目录路径。
root /usr/share/nginx/html;
}
}
if ($http_user_agent ~ "YunSecurityBot|BBScan|360Spider|YisouSpider|AhrefsBot|qihoobot|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot|CometHTTP|MJ12bot|Feedly|YandexBot|HttpClient|omgili|Python-urllib|python-requests") {
return 416;
}
发表回复