From 3a475b55a9c52b6f0b371489b57f0459b163f69b Mon Sep 17 00:00:00 2001 From: pdiogoantunes Date: Fri, 26 May 2017 11:07:55 +0200 Subject: [PATCH] ajout blocage user-agent --- HowtoNginx.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/HowtoNginx.md b/HowtoNginx.md index 7ef123f9..0165de57 100644 --- a/HowtoNginx.md +++ b/HowtoNginx.md @@ -283,6 +283,14 @@ server { } ~~~ +### Selon user-agent + +~~~ + if ($http_user_agent ~* (DotBot|Cliqzbot|AhrefsBot|SemrushBot)) { + return 404; + } +~~~ + ### Page personnalisé selon code erreur HTTP Contrairement à apache, on ne pourra indiquer une conf général à inclure qui s'appliquera pour tout les vhosts, mais il faudra ajouter l'include sur tout les fichier de confs des vhosts.