From 81e3e145c1b76d532d542400b274daf8093c6dc8 Mon Sep 17 00:00:00 2001 From: Minjong Kim Date: Wed, 2 Sep 2020 21:43:20 +0900 Subject: [PATCH] Update nginx.tmpl Prevent incorrect loading of wildcard domains in vhost configuration loading --- nginx.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.tmpl b/nginx.tmpl index 07e2b50..dd44174 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -353,7 +353,7 @@ server { {{ end }} {{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }} - include {{ printf "/etc/nginx/vhost.d/%s" $host }}; + include {{ printf "/etc/nginx/vhost.d/%s" (replace $host "*" "\\*" -1) }}; {{ else if (exists "/etc/nginx/vhost.d/default") }} include /etc/nginx/vhost.d/default; {{ end }} @@ -376,7 +376,7 @@ server { auth_basic_user_file {{ (printf "/etc/nginx/htpasswd/%s" $host) }}; {{ end }} {{ if (exists (printf "/etc/nginx/vhost.d/%s_location" $host)) }} - include {{ printf "/etc/nginx/vhost.d/%s_location" $host}}; + include {{ printf "/etc/nginx/vhost.d/%s_location" (replace $host "*" "\\*" -1) }}; {{ else if (exists "/etc/nginx/vhost.d/default_location") }} include /etc/nginx/vhost.d/default_location; {{ end }}