Update nginx.tmpl

Prevent incorrect loading of wildcard domains in vhost configuration loading
This commit is contained in:
Minjong Kim 2020-09-02 21:43:20 +09:00 committed by GitHub
parent b0c6c9f67e
commit 81e3e145c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 }}