From ed88fdfe1765fe1778b91c72eb45d8c9aaad2977 Mon Sep 17 00:00:00 2001 From: boksbc Date: Fri, 24 Oct 2025 14:05:07 +0200 Subject: [PATCH] Dovecot Systax Problem --- scripts/70-nginx.sh | 104 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 9 deletions(-) diff --git a/scripts/70-nginx.sh b/scripts/70-nginx.sh index f71110d..56f4590 100644 --- a/scripts/70-nginx.sh +++ b/scripts/70-nginx.sh @@ -115,14 +115,88 @@ fi # echo "}" >> "$outfile" #} -build_site_http_only(){ - local host="$1" outfile="$2" +#build_site_http_only(){ +# local host="$1" outfile="$2" +# +# # DEV: IP-Zugriff ohne Hostname → default_server + server_name _ +# local def="" +# if [[ "${DEV_MODE}" = "1" ]]; then +# def=" default_server" +# host="_" +# fi +# [[ -z "${host}" || "${host}" = "_" ]] && host="_" +# +# cat > "$outfile" <> "$outfile" <<'CONF' +# # DEV: Vite-Proxy (HMR) +# location ^~ /@vite/ { proxy_pass http://127.0.0.1:5173/@vite/; proxy_set_header Host $host; } +# location ^~ /node_modules/ { proxy_pass http://127.0.0.1:5173/node_modules/; proxy_set_header Host $host; } +# location ^~ /resources/ { proxy_pass http://127.0.0.1:5173/resources/; proxy_set_header Host $host; } +#CONF +# fi +# +# echo "}" >> "$outfile" +#} + +# $1=host, $2=outfile, $3=default_flag (default|nodefault) +build_site_http_only(){ + local host="$1" outfile="$2" def_flag="${3:-default}" - # DEV: IP-Zugriff ohne Hostname → default_server + server_name _ local def="" - if [[ "${DEV_MODE}" = "1" ]]; then + if [[ "${DEV_MODE}" = "1" && "${def_flag}" = "default" ]]; then def=" default_server" - host="_" fi [[ -z "${host}" || "${host}" = "_" ]] && host="_" @@ -133,7 +207,6 @@ server { listen [::]:80${def}; server_name ${host}; - # ACME HTTP-01 (optional; meist übernimmt das der Proxy) location ^~ /.well-known/acme-challenge/ { root ${ACME_ROOT}; allow all; @@ -339,9 +412,9 @@ WEBMAIL_SITE="/etc/nginx/sites-available/webmail-mailwolt.conf" # UI & Webmail … if [[ "${DEV_MODE}" = "1" ]]; then - # DEV: per IP erreichbar → Catch-All („_“) und HTTP-only - build_site_http_only "_" "$UI_SITE" - build_site_http_only "_" "$WEBMAIL_SITE" + # UI = Catch-All + default_server, Webmail = Catch-All ohne default + build_site_http_only "_" "$UI_SITE" "default" + build_site_http_only "_" "$WEBMAIL_SITE" "nodefault" else if [[ "${PROXY_MODE:-0}" -eq 1 ]]; then build_site_http_only "$UI_HOST" "$UI_SITE" @@ -351,6 +424,19 @@ else build_site_tls "$WEBMAIL_HOST" "/etc/ssl/webmail" "$WEBMAIL_SITE" fi fi +#if [[ "${DEV_MODE}" = "1" ]]; then +# # DEV: per IP erreichbar → Catch-All („_“) und HTTP-only +# build_site_http_only "_" "$UI_SITE" +# build_site_http_only "_" "$WEBMAIL_SITE" +#else +# if [[ "${PROXY_MODE:-0}" -eq 1 ]]; then +# build_site_http_only "$UI_HOST" "$UI_SITE" +# build_site_http_only "$WEBMAIL_HOST" "$WEBMAIL_SITE" +# else +# build_site_tls "$UI_HOST" "/etc/ssl/ui" "$UI_SITE" +# build_site_tls "$WEBMAIL_HOST" "/etc/ssl/webmail" "$WEBMAIL_SITE" +# fi +#fi # MX: **immer** ACME-only (kein Laravel dahinter) build_site_acme_only "${MAIL_HOSTNAME}" "$MX_SITE"