summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoro <o@immerda.ch>2015-03-10 19:05:31 +0100
committero <o@immerda.ch>2015-03-10 19:05:31 +0100
commitfa295b03762a0ae3220b8dcade7155674bb71ac0 (patch)
treed1595d9f67100e0e40b2c75c4b9d40c90fa60aee
parent39bbb27079fe22ad3ed0f220d32ff5f3ce3cb666 (diff)
support per-vhost hsts headers
-rw-r--r--templates/vhosts/partials/ssl.erb3
1 files changed, 3 insertions, 0 deletions
diff --git a/templates/vhosts/partials/ssl.erb b/templates/vhosts/partials/ssl.erb
index 24e28f5..c9f3933 100644
--- a/templates/vhosts/partials/ssl.erb
+++ b/templates/vhosts/partials/ssl.erb
@@ -3,3 +3,6 @@
<% if configuration['ssl_certificate_chain_file'] || scope.lookupvar('apache::default_ssl_certificate_chain_file') != 'absent' -%>
SSLCertificateChainFile <%= configuration['ssl_certificate_chain_file'] || scope.lookupvar('apache::default_ssl_certificate_chain_file') %>
<% end -%>
+<% if configuration['hsts'] -%>
+ Header add Strict-Transport-Security "max-age=<%= (configuration['hsts']['age'] || 15768000) rescue 15768000 %>"
+<% end -%>