Merge 26f55bfcdf
into 2f898566fc
This commit is contained in:
commit
0b3335029f
1 changed files with 18 additions and 0 deletions
18
nginx.tmpl
18
nginx.tmpl
|
@ -197,6 +197,12 @@ log_format vhost '$host $remote_addr - $remote_user [$time_local] '
|
|||
|
||||
access_log off;
|
||||
|
||||
{{ range $key, $val := .Env }}
|
||||
{{ if and $val (hasPrefix "nginx_" (toLower $key)) }}
|
||||
{{ trimPrefix "nginx_" (toLower $key) }} {{ $val }};
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Get the SSL_POLICY defined by this container, falling back to "Mozilla-Intermediate" */}}
|
||||
{{ $ssl_policy := or ($.Env.SSL_POLICY) "Mozilla-Intermediate" }}
|
||||
{{ template "ssl_policy" (dict "ssl_policy" $ssl_policy) }}
|
||||
|
@ -383,6 +389,12 @@ server {
|
|||
add_header Strict-Transport-Security "{{ trim $hsts }}" always;
|
||||
{{ end }}
|
||||
|
||||
{{ range $key, $val := (first $containers).Env }}
|
||||
{{ if and $val (hasPrefix "nginx_" (toLower $key)) }}
|
||||
{{ trimPrefix "nginx_" (toLower $key) }} {{ $val }};
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }}
|
||||
include {{ printf "/etc/nginx/vhost.d/%s" $host }};
|
||||
{{ else if (exists "/etc/nginx/vhost.d/default") }}
|
||||
|
@ -431,6 +443,12 @@ server {
|
|||
{{ end }}
|
||||
{{ $access_log }}
|
||||
|
||||
{{ range $key, $val := (first $containers).Env }}
|
||||
{{ if and $val (hasPrefix "nginx_" (toLower $key)) }}
|
||||
{{ trimPrefix "nginx_" (toLower $key) }} {{ $val }};
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }}
|
||||
include {{ printf "/etc/nginx/vhost.d/%s" $host }};
|
||||
{{ else if (exists "/etc/nginx/vhost.d/default") }}
|
||||
|
|
Loading…
Reference in a new issue