Answer the question
In order to leave comments, you need to log in
How to see requests blocked by Nginx, IP list?
Good afternoon!
For several days now, the server has received 100-300 GB of daily incoming requests, which I can’t see from where and where they go.
Server on Hetzner, only ports 80 and 443 are outside (hardware firewall). Most of the requests are handled by Nginx.
It turns out this order of firewalls:
1. Cloudflare (some countries are blocked)
2. Hetzner Hardware - - only 80, 443 out
3. Server Software Firewall - only 80, 443 out
4. Nginx which blocks everything suspicious.
1. I look online through Logtop / analyze site logs - I don’t see anything abnormal, any requests or connections of a large number from certain IP addresses.
Online mode :
tail -f /var/log/apache2/domains/*.log | cut -d ' ' -f 1 | logtop -c 100000
awk '{print $1}' /var/log/apache2/domains/*.log | grep -Ev ':|66.249' | sort | uniq -c | sort -nr | head -n 50
Answer the question
In order to leave comments, you need to log in
if you have nginx - why are you watching apache logs?
ps 403 nginx writes to the error log if I don't confuse anything
In general, I decided at the 1st level of protection - Cloudflare - to add to the rules a ban on all the main server subnets that I know and that are banned by Nginx + annoying bots. By default, they also have a SYN block for packets and other garbage. But the problem is that not all domains go through the Cloud, maybe they just flooded the IP address, I haven’t figured out how to protect it in the future.
Dos itself was served up to 40Mbps, today they stopped as abruptly as they started.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question