Skip to content

Instantly share code, notes, and snippets.

@tiagoad
Created July 21, 2016 10:40
Show Gist options
  • Save tiagoad/2200a48e95980f32df92fe5c5259575f to your computer and use it in GitHub Desktop.
Save tiagoad/2200a48e95980f32df92fe5c5259575f to your computer and use it in GitHub Desktop.
Cronjob to block tor exit nodes with nginx on debian 8 jessie
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
@atrakic
Copy link

atrakic commented Sep 24, 2020

Nice

@nuno-aj-aniceto
Copy link

nuno-aj-aniceto commented Sep 7, 2023

Very good, thank you !

Still, I recommend to use nginx -s reload instead of systemctl reload nginx
Because that in some systems we don't really have systemctl, ie: some kubernetes standard pods.. but we always have nginx.
;-)

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; nginx -s reload ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment