Ask HN: Best way to block an EC2-hosted scraper?
Windy Citizen gets slooooow about once every hour and according to our logs, around this same time, someone or something is making a ton of requests to our RSS feeds, grabbing hundreds of them at once.
From what I can tell, the thing grabbing this stuff is hosted on Amazon EC2. I've tried blocking the IP address before but it seems to refresh and then the problem comes back. How do I shut this idiot down?
The feed URLs being grabbed are all have the following URL format: /neighborhood//feed
These are old URLs from a prior schema we had. They're not even valid anymore. I think this is part of the problem. Basically this scraper is causing a ton of 404s every 30 minutes.
Is there a way to just block out anything trying to hit URLs that match a regex for that URL structure? Something else?
Update: I've added this to my nginx.conf file:
location ~ /neighborhoods/[-\w]+/feed/?$ { deny all; }
And it appears to be working. It's successfully sending a 403 when people request those URLs.
Now, anyone have suggestions for fun things I can redirect the scraper to?