mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-02 06:45:45 +00:00
Add support for adding options to the location block of a vhost
This commit is contained in:
10
nginx.tmpl
10
nginx.tmpl
@ -135,6 +135,11 @@ server {
|
||||
auth_basic "Restricted {{ $host }}";
|
||||
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"}}
|
||||
{{ else if (exists /etc/vhost.d/defaults_location) }}
|
||||
include /etc/nginx/vhost.d/defaults_location
|
||||
{{ end }}
|
||||
}
|
||||
}
|
||||
{{ else }}
|
||||
@ -155,6 +160,11 @@ server {
|
||||
auth_basic "Restricted {{ $host }}";
|
||||
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"}}
|
||||
{{ else if (exists /etc/vhost.d/defaults_location) }}
|
||||
include /etc/nginx/vhost.d/defaults_location
|
||||
{{ end }}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user