From f963e86cddb60f6c6d6ab6341bdb5279c728e525 Mon Sep 17 00:00:00 2001 From: btatu Date: Sat, 28 Dec 2019 13:24:50 +0100 Subject: [PATCH] Bloquer un User-Agent --- HowtoApache.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/HowtoApache.md b/HowtoApache.md index a3d2c3e9..92302986 100644 --- a/HowtoApache.md +++ b/HowtoApache.md @@ -1210,12 +1210,14 @@ SetEnvIfNoCase X-Forwarded-Proto https HTTPS=on Ainsi l'application saura qu'elle est accédée en HTTPS à condition que le reverse proxy soit bien configuré et envoie X-Forwarded-Proto. -### Interdire en fonction du User-Agent +### Bloquer un User-Agent + +On peut bloquer des bots faisant des requêtes non légitimes via : ~~~{.apache} - - Require expr %{HTTP_USER_AGENT} !~ /Nutch/ - +RewriteEngine on +RewriteCond %{HTTP_USER_AGENT} python-requests.* [NC] +RewriteRule . - [R=403,L] ~~~ ### Site avec accents cassés