mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-03 07:15:46 +00:00
Merge branch 'master' into ssl-modern
This commit is contained in:
@ -161,6 +161,9 @@ upstream {{ $upstream_name }} {
|
||||
{{/* Get the MODERN_SSL defined by containers w/ the same vhost, falling back to "false" */}}
|
||||
{{ $modern_ssl := or (first (groupByKeys $containers "Env.MODERN_SSL")) "false" }}
|
||||
|
||||
{{/* Get the HSTS defined by containers w/ the same vhost, falling back to "max-age=31536000" */}}
|
||||
{{ $hsts := or (first (groupByKeys $containers "Env.HSTS")) "max-age=31536000" }}
|
||||
|
||||
{{/* Get the VIRTUAL_ROOT By containers w/ use fastcgi root */}}
|
||||
{{ $vhost_root := or (first (groupByKeys $containers "Env.VIRTUAL_ROOT")) "/var/www/public" }}
|
||||
|
||||
@ -233,8 +236,8 @@ server {
|
||||
ssl_trusted_certificate {{ printf "/etc/nginx/certs/%s.chain.crt" $cert }};
|
||||
{{ end }}
|
||||
|
||||
{{ if (ne $https_method "noredirect") }}
|
||||
add_header Strict-Transport-Security "max-age=31536000";
|
||||
{{ if (and (ne $https_method "noredirect") (ne $hsts "off")) }}
|
||||
add_header Strict-Transport-Security "{{ trim $hsts }}";
|
||||
{{ end }}
|
||||
|
||||
{{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }}
|
||||
|
Reference in New Issue
Block a user