My app MERN in hosted on Heruku. I see a lot of requests running in the console (heroku logs --tail)in the same second, looks like they are automated.
Requests have weird things inside. Example is path="/get-spot-by-type-key?key=ifIJnFkezs2v4X**.php**&type=business" "if" and "php" is something we don't have usually. All requests are from the same fwd.
How to block them?
Looks like you are being scanned by some attack proxy. There is no easy solution around it I believe. Or better to say - the solutions may have side effects. You can:
If your website offers resources to authenticated users only - blacklist the user. (ok, this might be actually quite simple but works under certain conditions)
There are other solutions you may want to use like showing users some captcha when you recognize unusual traffic, but they require a bit of implementation effort.
Also you may want to consider hiding your server behind cloudflare or similar and let someone else handle the security response.