Forum Discussion
ekanathdas_2662
May 14, 2012Nimbostratus
HSTS (HTTP Strict Transport Security)
Hi team, Was trying the HSTS irule posted in "https://devcentral.f5.com/weblogs/d...start.aspx". The vip on port 80 already had a ssl redirect irule (http to https). When the below irule...
ekanathdas_2662
Jun 18, 2012Nimbostratus
Yes, the virtuals have the http profile associated to them.
I believe , i am overlooking somewhere and getting the irule error. Should not the time be defined i n rule? Anywhere else should it be defined?
===error===
Jun 18 10:10:40 tmm tmm[1099]: 01220001:3: TCL error: Rule HSTS-HTTPS - can't read "static::expires": no such variab
le while executing "expr {$static::expires - [clock seconds]}"
===i rule on http virtual===
when HTTP_REQUEST {
HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]"
}
==i rule on https virtual===
when RULE_INIT {
set static::expires [clock scan 9504000]
}
when HTTP_RESPONSE {
HTTP::header insert Strict-Transport-Security "max-age=[expr {$static::expires - [clock seconds]}]"
}
Thanks.
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