# A way to map IPs to the "T1" country code, for tor exit node identification. For sites not using cloudflare.
# 1. (optional) Add this to a cronjob
# 2. Add "include /etc/nginx/includes/map.conf;" to the http block of your /etc/nginx/nginx.conf
# 2. Add "include /etc/nginx/snippets/map.conf;" to the http block of your /etc/nginx/nginx.conf
# 3. Change all the proxy_set_header directives in your nginx config to use the $mapped_country_code variable instead of $geoip_country_code or a fixed value like 'TOR'
# 4. (optional) If you want to instead redirect all these known exits to your .onion instead, add "if ($mapped_country_code = "T1") { return 302 'http://xxxx.onion$request_uri'; }" to your clearnet vhost (server block) of your jschan nginx sites-available config