From 798c9d6892217c505be13ecae449045a4ac5c8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Sun, 13 Nov 2022 19:17:09 +0900 Subject: [PATCH] =?UTF-8?q?=E3=80=90nginx=E3=80=91Tor=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=82=B6=E3=83=BC=E3=81=AF=E8=87=AA=E5=8B=95=E3=81=A7.onion?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AB=E7=A7=BB=E8=BB=A2=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automatic-nginx-tor-redirect/index.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 src/blog/automatic-nginx-tor-redirect/index.md 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 <