3 ms·
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 ser
by kijin 11mo 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.
- palsecam 11mo agoYes @ 444 (https://http.cat/status/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).
- MadnessASAP 11mo agoDoes 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)
- quesera 11mo agoBeware 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.