1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2024-12-26 04:26:31 +00:00

Add HSTS header regardless of status code

See nginx [doc](http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header) and [blog](https://www.nginx.com/blog/http-strict-transport-security-hsts-and-nginx/).
This commit is contained in:
b1f6c1c4 2018-02-20 17:59:52 +08:00 committed by GitHub
parent 226bfe158f
commit 7a769a6a22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,7 +260,7 @@ server {
{{ end }}
{{ if (and (ne $https_method "noredirect") (ne $hsts "off")) }}
add_header Strict-Transport-Security "{{ trim $hsts }}";
add_header Strict-Transport-Security "{{ trim $hsts }}" always;
{{ end }}
{{ if (exists (printf "/etc/nginx/vhost.d/%s" $host)) }}