「Linux/nginx/拒否」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「/etc/nginx/conf.d/hogehoge.conf server { listen 80; #default_server; if ( $http_user_agent ~* (SemrushBot|AhrefsBot) ) { return 403; } }」) |
|||
| 行6: | 行6: | ||
} | } | ||
} | } | ||
| + | |||
| + | 参考:https://blog.mitsuto.com/nginx-useragent-deny | ||
2019年2月6日 (水) 00:05時点における版
/etc/nginx/conf.d/hogehoge.conf
server {
listen 80; #default_server;
if ( $http_user_agent ~* (SemrushBot|AhrefsBot) ) {
return 403;
}
}
