HSTS for SSL Terminated Environments

This commit is contained in:
Philip Bjorge 2017-06-27 17:47:00 -07:00 committed by GitHub
parent 005ed5243f
commit a03c6c088a

View file

@ -298,7 +298,7 @@ http {
ssl_certificate_key {{ $server.SSLCertificate }};
{{ end }}
{{ if (and (not (empty $server.SSLCertificate)) $cfg.HSTS) }}
{{ if (and $cfg.HSTS (or (not (empty $server.SSLCertificate)) $location.Redirect.ForceSSLRedirect)) }}
more_set_headers "Strict-Transport-Security: max-age={{ $cfg.HSTSMaxAge }}{{ if $cfg.HSTSIncludeSubdomains }}; includeSubDomains{{ end }};{{ if $cfg.HSTSPreload }} preload{{ end }}";
{{ end }}