Skip to content

Instantly share code, notes, and snippets.

@nfsarmento
nfsarmento / nginx-block-tor-ip.sh
Created December 27, 2019 13:58
nginx block tor
wget -qO- https://check.torproject.org/exit-addresses | grep ExitAddress | cut -d ' ' -f 2 | sed "s/^/deny /g; s/$/;/g" > /etc/nginx/conf.d/tor-block.conf; systemctl reload nginx
#next add the following to your nginx site conf
#In nginx you then just include the blacklist.
include /etc/nginx/conf.d/tor-block.conf;
#The file contains statements like this: