From 2010332395cfb54121bb4597051ab8463c4be550 Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Sun, 22 Feb 2015 09:25:50 -0800 Subject: [PATCH] Support per-VIRTUAL_HOST Nginx conf files --- nginx.tmpl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nginx.tmpl b/nginx.tmpl index b694a31..62a6d4b 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -107,6 +107,10 @@ server { add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; + {{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }} + include {{ printf "/etc/nginx/vhost.d/%s" $host }}; + {{ end }} + location / { proxy_pass {{ $proto }}://{{ $host }}; {{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }} @@ -120,6 +124,10 @@ server { server { server_name {{ $host }}; + {{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }} + include {{ printf "/etc/nginx/vhost.d/%s" $host }}; + {{ end }} + location / { proxy_pass {{ $proto }}://{{ $host }}; {{ if (exists (printf "/etc/nginx/htpasswd/%s" $host)) }}