I really grew tired of having an old rss feed hit 404s on my website. From what I've read the best way to retire it is to respond with a 410 message, and the program that makes all those requests will stop, in theory any way.
I've added the following lines in my nginx conf:
location ~ / {
if ($uri ~ "/my/old/url") {
return 410;
}
..
}
To make it prettier, I also added:
error_page 410 /410.html
The syntax is a bit odd though, because the 410 ("
It's gone") is not an http error code.
You can add additional codes such as 502 (bad gateway) or 503 (service not available) and style them to your hearts content.