1

My site was under attack and I noticed all the user agents are blank. How can I block this with my nginx?

Screenshot of Log File

I have no idea what to block, if this is an empty user agent or what.

1 Answers1

4

If you want to block blank user agents by sending them a "403" or access denied message then this should work:

if ($http_user_agent = "") { return 403; }

Modifying this to do other things should be straightforward.

greggles
  • 131
  • 1
  • 10