Forum Discussion
DJDX21_252164
May 17, 2016Cirrus
Strict-Transport-Security (HSTS) header throws Operation not supported errors
This is my iRule to add "Strict-Transport-Security" header to my http response code. when HTTP_RESPONSE {
set strictTransportSecurityHeader {Strict-Transport-Security}
if { [HTTP::head...
Stanislas_Piro2
May 18, 2016Cumulonimbus
Hi,
The HSTS irule must be applied to HTTPS VS and not HTTP.
to be sure this irule is executed before other, you can add priority to this irule event and disable event if Policy action is redirect.
when HTTP_RESPONSE priority 1 {
if {[POLICY::targets http-reply] } {
log local0. "LTM Policy action contains redirect. Disabling event"
event disable
return
}
set strictTransportSecurityHeader "Strict-Transport-Security"
if { [HTTP::header exists $strictTransportSecurityHeader] } {
HTTP::header remove $strictTransportSecurityHeader
}
HTTP::header insert $strictTransportSecurityHeader "max-age=31536000; includeSubDomains"
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects