From 9b48c4731a3d3ca22960dd43bd3aadef0f0c66b4 Mon Sep 17 00:00:00 2001
From: Christian Ditaputratama <ditatompel@gmail.com>
Date: Sat, 16 Nov 2024 19:01:09 +0700
Subject: [PATCH] feat: Added tor hidden service via HTTP header #161

The `Onion-Location` header was added to Nginx example configuration.
---
 README.md                   | 1 +
 deployment/nginx/vhost.conf | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/README.md b/README.md
index 38db15c..45198f8 100644
--- a/README.md
+++ b/README.md
@@ -85,6 +85,7 @@ See the [Makefile](./Makefile).
 -   :white_check_mark: Use `a-h/templ` and `HTMX` instead of `Svelte`.
 -   Use Go standard `net/http` instead of `fiber`.
 -   :white_check_mark: Accept I2P nodes.
+-   :white_check_mark: Support Tor hidden service (beta, inform via HTTP header).
 
 ## Acknowledgement
 
diff --git a/deployment/nginx/vhost.conf b/deployment/nginx/vhost.conf
index 700b2bc..528127c 100644
--- a/deployment/nginx/vhost.conf
+++ b/deployment/nginx/vhost.conf
@@ -44,6 +44,9 @@ server {
     add_header X-XSS-Protection "1; mode=block";
     add_header X-Download-Options noopen;
 
+    # Add your onion URL here if you support it
+    # add_header Onion-Location http://<YOUR-ONION-ADDRESS>.onion$request_uri;
+
     location = /robots.txt {
         log_not_found off;
         access_log    off;