Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Automatically redirect Tor traffic to onion (Hopefully efficiently as the if processing isn't intensive)
##Get New Exit Node list ever 6 Hours
57 */6 * * * `curl\?ip\=<yourip> | awk '{print $0" TOREX;"}' > /etc/nginx/includes/torexit.ips && service nginx restart`
##Create a geo region for Tor Exits
geo $torexit {
default NOEXIT;
include includes/torexit.ips;
##Check on every request if Tor Exit, potentially inefficient, but the geolookup is quicker than a long list of ifs.
if ($torexit = TOREX) {
rewrite ^ https://xxxxxxxxxxxxxxxxxx.onion$request_uri? permanent;

This comment has been minimized.

Copy link

@alecmuffett alecmuffett commented Feb 16, 2018

That's really interesting; thanks, Chris - I'll look it over.


This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.