/block-tor-with-nginx

Deny access to Tor users with nginx

Primary LanguageShell

Prevent Tor users from accessing the server

block Tor in nginx

Usage

  1. Upload block-tor.sh to /etc/nginx/
  2. Add a Cron job, Tor Exit List will be updated daily at 5 in the morning
00 05 * * * sh /etc/nginx/block-tor.sh
  1. Create empty file tor-ip-list.conf in /etc/nginx/conf.d/ or run block-tor.sh manually
  2. Include Tor Exit List in nginx configuration file
include /etc/nginx/conf.d/tor-ip-list.conf;
  1. Test the configuration file
sudo nginx -t

If everything is ok reload nginx configuration

sudo systemctl reload nginx