1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-07-02 06:45:45 +00:00

Merge pull request #106 from md5/per-vhost-includes

Per VIRTUAL_HOST configuration files
This commit is contained in:
Jason Wilder
2015-02-23 12:20:55 -07:00
2 changed files with 46 additions and 0 deletions

View File

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