I have website which recently got so much traffic that my server load went to sky.
load average: 83.99, 72.89, 77.70
My website is hosted on dedicated server with 64 GB RAM and Intel i7 6700k CPU. and is behind cloudflare.
I don't use any analytics to track visitors.
From last 3-4 days, traffic increased and I was under impression, that its regular traffic on my website, until I found out while surfing other sites using google search, that some other website was acting as online/reverse proxy and loading my site as their own and his site had way more traffic that mine, so I accessed
https://www.whatismyip.com/
using that site's proxy e.g.
www.example.com/proxy_url=https://www.whatismyip.com
to get the IP address and then blocked his IP address in cloudflare. This method is not feasible everytime someone proxies to my website.
So how can I find out if any IP address is making too many requests to my site?
Issue Solved. What i did 1) Enable Logs on NGINX
nginx.conf
http{
#main log format for capturing real ip addresses
log_format main '$http_x_forwarded_for - $remote_user [$time_local] "$host" "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $request_time';
}
mydomain.com.conf
server{
access_log /usr/local/nginx/logs/access.log main;
}
nginx -t
service nginx restart
2) i went to the site which was reverse proxying to my site. and tried to access some non existed page.
e.g. https://www.proxy-example.com/proxy_url=https://www.my-example.com/BAN_THIS_IP
3) I checked my logs for the BAN_THIS_IP
cat /usr/local/nginx/logs/access.log | grep BAN_THIS_IP
and found the server's IP address.
4) Added that IP address, in cloudflare and set to Block.
Thanks