소스 검색

Support per-VIRTUAL_HOST Nginx conf files

Mike Dillon 10 년 전
부모
커밋
2010332395
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      nginx.tmpl

+ 8 - 0
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)) }}