handle hsts header injection in lua

This commit is contained in:
Elvin Efendi 2019-09-24 14:57:17 -04:00
parent daf8634acf
commit c5a8357f1d
3 changed files with 28 additions and 7 deletions

View file

@ -1051,12 +1051,6 @@ stream {
plugins.run()
}
{{ if (and $server.SSLCert $all.Cfg.HSTS) }}
if ($scheme = https) {
more_set_headers "Strict-Transport-Security: max-age={{ $all.Cfg.HSTSMaxAge }}{{ if $all.Cfg.HSTSIncludeSubdomains }}; includeSubDomains{{ end }}{{ if $all.Cfg.HSTSPreload }}; preload{{ end }}";
}
{{ end }}
{{ if not $location.Logs.Access }}
access_log off;
{{ end }}