diff --git a/src/blog/automatic-nginx-tor-redirect/index.md b/src/blog/automatic-nginx-tor-redirect/index.md new file mode 100644 index 0000000..c394e99 --- /dev/null +++ b/src/blog/automatic-nginx-tor-redirect/index.md @@ -0,0 +1,168 @@ +title: 【nginx】Torユーザーは自動で.onionリンクに移転方法 +author: 凛 +date: 2022-11-13 +tags: jp,blog,linux,bsd,nginx,tor,ダークネット,server,匿名化,ウエブ開発 +---- +Torを使って「technicalsuwako.moe」にアクセスしてみたら、自動で「6qiatzlijtqo6giwvuhex5zgg3czzwrq5g6yick3stnn4xekw26zf7qd.onion」に移転させると気づきましたか?\ +今回はやり方を解決すると思います。 + +## コンフィグファイルの作成 + +まずは2つのファイルを作成して下さい。\ +`nginx-tor-geo.conf`で何も入らなくてはOKです。\ +`generate-geo-file.sh`で自動で入力させられますから。 + +```sh +touch /etc/nginx/conf.d/nginx-tor-geo.conf +nvim /etc/nginx/generate-geo-file.sh +``` + +```sh +IPADDR="$(curl -s https://check.torproject.org/exit-addresses | \ + grep ExitAddress | \ + awk '{print "\t" $2 " 1;"}' | \ + sort -u)" +cat > /etc/nginx/nginx-tor-geo.conf <