Note: The below will prevent any TOR IP from accessing your site or accessing any files linked or hosted by your site.
Daily updated TOR Exit IP List here:
Hourly checked and updated list of IP Addresses of Tor and Tor Exit Nodes - platformcosmo/Tor-IP-Addresses
github.com
Write the output of that into /etc/nginx/tor-ip.conf
Note: You will need to prepend each IP with deny and end it with a ;
Example: deny 100.10.14.116;
Include the file in your NGINX config:
sudo vi /etc/nginx/sites-enabled/default
server {
include /etc/nginx/tor-ip.conf;
}
Reload:
sudo nginx -t && sudo nginx -s reload