How can I bann or block automatically all IPs that reached 404 page from a large access log? I am using Nginx on Ubuntu 16.04, so I want to do it via Nginx.
It can't be done manually because the log has more than a million logs. So is there a way this can be done?
EDIT:
So to achieve this task I have to do the filtering of the log first and than to deny all of the ips from Nginx.
How to create a file with the filtered IPs that match my criteria - all the ones that hit 404