0

I am getting a lot of bad requests from a crawler at a specific IP Address non-stop. I added the IP to the blocked list and cleared the cache, but I still see more requests in the dblog coming in from the IP:

HTTP response: Bad Request. URL: https://valid.url.example.com/api/123456>; rel="canonical",<https:.json.

Why can they still send requests? Is there a way to prevent these?

2
  • I guess you can't prevent requests on request process layer because that layer only happens when a request is processed. Although you see the dblog entry, Drupal is not processing the request (serving content), because the IP module blocks further processing. If you want to avoid requests completely you have to di it at webserver/proxy/load balancer level.
    – sanzante
    Jun 28, 2019 at 14:46
  • @sanzante I suppose if the IP keeps flooding the logs in the same way for another week or two, I could look into that.
    – mbomb007
    Jun 28, 2019 at 18:42

1 Answer 1

2

Flood control is just for failed login attempts and some other stuff like forms being filled out. It will not keep your bad bot from the site.

Assuming you have an Apache server, you can modify the .htaccess file in the root of your site to block specific ip with the DENY FROM {ip} directive. E.g. adding something like this to the top.

order allow,deny
deny from 255.0.0.0
deny from 123.45.6.
allow from all

If you don't have Apache / .htaccess support, the process will be different.

1
  • I use Nginx, but it would be pretty simple to find how to do that.
    – mbomb007
    Jun 28, 2019 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.