Comment by kijin
16 hours ago
nginx also has "return 444", a special code that makes it drop the connection altogether. This is quite useful if you don't even want to waste any bandwidth serving an error page. You have an image on your error page, which some crappy bots will download over and over again.
Beware of nginx 444 if your webserver is behind a load balancer.
The LB will see the unresponded requests and think your webserver is failing.
Ideal would be to respond at the webserver and let the LB drop the response.
Yes @ 444 (https://http.cat/status/444). That’s indeed the lightest-weight option.
> You have an image on your error page, which some crappy bots will download over and over again.
Most bots won’t download subresources (almost none of them do, actually). The HTML page itself is lean (475 bytes); the image is an Easter egg for humans ;-) Moreover, I use a caching CDN (Cloudflare).
Does it also tell the kernel to drop the socket? Or is a TCP FIN packet still sent?
Be better if the scraper is left waiting for a packet that'll never arrive (till it times out obviously)