I have a, let's call it, "legacy" VHost configured on an nginx server. It used to be a full site, but it has since been decommissioned and all the content removed. The server
block now looks something like this:
server {
listen 80;
server_name defunct-site.com;
return 410;
}
There are DNS records and applications which are out of my control that still point to this server, and it still gets relatively significant traffic despite my pleads to the third party to update their configuration and stop trying to hit the site. Needless to say, I can't change my IP address without significant pointless effort.
Is there a stronger way to tell these clients that their traffic is no longer welcome here? The source IPs are all over the place, so doing a successful iptables block seems unlikely. And I need to read enough of the HTTP request to get to the Host:
header to make sure I'm not clobbering traffic intended for a legitimate VHost.
410 Gone is the canonical error to return for content which no longer exists and is known to never be returning. In particular, it also tells search engines this, so that they can lower the ranking of, or delist, such URLs.
One additional thing you can do is to provide an
error_document
for it, to explain to people who visit the site what is going on. Without it, all they will see is an uninformative "410 Gone". For instance:This will be just a static HTML document that contains whatever you wish, and you can be as rude as you like.