My site was under attack and I noticed all the user agents are blank. How can I block this with my nginx?
I have no idea what to block, if this is an empty user agent or what.
My site was under attack and I noticed all the user agents are blank. How can I block this with my nginx?
I have no idea what to block, if this is an empty user agent or what.
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.