Here’s a simple configuration that will identify bots and redirect them to unsupported page.
location / { set $isbot 0; if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|bot|curl|wget|facebookexternalhit|twitterbot|developers\.google\.com") {
set $isbot 1;
} if($isbot) {
# bot identified...
rewrite .* /$scheme://$host/unsupported.html break;
} try_files $uri $uri/ /index.html;}