Files
nullcart_promo_website/nginx/docker-entrypoint.sh
T
nobswebdev ebfe68c132 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".
2026-09-11 16:27:36 +02:00

19 lines
485 B
Bash
Executable File

#!/bin/sh
set -eu
export 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
cp /etc/nginx/templates/conf.d/onion.conf /etc/nginx/conf.d/onion.conf
exec nginx -g 'daemon off;'