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