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

1 Answer 1

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.

You must log in to answer this question.