net/haproxy: HSTS is only applicable to HTTP frontends

This commit is contained in:
Frank Wall
2017-12-08 00:31:13 +01:00
committed by Franco Fichtner
parent 190b48b3e5
commit 139ef0a634
@@ -607,7 +607,7 @@ frontend {{frontend.name}}
{% do ssl_options.append('ciphers ' ~ frontend.ssl_cipherList) %}
{% endif %}
{# # HSTS #}
{% if frontend.ssl_hstsEnabled|default("") == '1' %}
{% if frontend.ssl_hstsEnabled|default("") == '1' and frontend.mode == 'http' %}
http-response set-header Strict-Transport-Security max-age={{frontend.ssl_hstsMaxAge}}
{% endif %}
{% endif %}