From e8e5ccdf18dce88a5e33a9b12f2f2cdbd11d36fb Mon Sep 17 00:00:00 2001 From: ljm42 Date: Mon, 23 Sep 2024 12:59:05 -0700 Subject: [PATCH] redirect http TS url to https TS url --- etc/rc.d/rc.nginx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/etc/rc.d/rc.nginx b/etc/rc.d/rc.nginx index ab245da56..f6a5b27a5 100755 --- a/etc/rc.d/rc.nginx +++ b/etc/rc.d/rc.nginx @@ -289,6 +289,15 @@ build_servers(){ fi if [[ -n $TSFQDN ]]; then cat <<- EOF >>$SERVERS + # + # Redirect Tailscale http requests to https + # ex: http://tower.magicDNS.ts.net -> https://tower.magicDNS.ts.net + # + server { + $(listen $PORT) + server_name $TSFQDN; + return 302 https://$TSFQDN$PORTSSL_URL$request_uri; + } # # Port settings for https using Tailscale cert # ex: https://tower.magicDNS.ts.net