Add Onion-Location header for Tor Browser discovery.

Mirror NullCart's ONION_HOSTNAME env and nginx clearnet header so visitors on HTTPS see ".onion available".
This commit is contained in:
2026-09-11 16:27:36 +02:00
parent 169bbb8bad
commit ebfe68c132
4 changed files with 19 additions and 1 deletions
+8 -1
View File
@@ -2,7 +2,14 @@
set -eu
export CLEARNET_DOMAIN
envsubst '${CLEARNET_DOMAIN}' \
if [ -n "${ONION_HOSTNAME:-}" ]; then
export ONION_LOCATION_HEADER="add_header Onion-Location \"http://${ONION_HOSTNAME}\$request_uri\";"
else
export ONION_LOCATION_HEADER=""
fi
envsubst '${CLEARNET_DOMAIN} ${ONION_LOCATION_HEADER}' \
< /etc/nginx/templates/conf.d/clearnet.conf.template \
> /etc/nginx/conf.d/clearnet.conf