diff --git a/ext/lb/nginx/template.go b/ext/lb/nginx/template.go index 50c5b925..34bf37a2 100644 --- a/ext/lb/nginx/template.go +++ b/ext/lb/nginx/template.go @@ -128,6 +128,9 @@ http { ssl_certificate_key {{ $host.SSLCertKey }}; server_name{{ range $name := $host.ServerNames }} {{ $name }}{{ end }}; + # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months) + add_header Strict-Transport-Security max-age=15768000; + location / { {{ if $host.SSLBackend }}proxy_pass https://{{ $host.Upstream.Name }};{{ else }}proxy_pass http://{{ $host.Upstream.Name }};{{ end }} } @@ -153,4 +156,4 @@ http { include {{ .Config.ConfigBasePath }}/conf.d/*.conf; } -` \ No newline at end of file +`