Forum Discussion
Sanjeev_126346
Nimbostratus
Aug 12, 2014Http header insert depending on host
I need to have a http::header insert depending on host i get in request. Is that possible.
IheartF5_45022
Nacreous
Aug 13, 2014You need to set a variable in HTTP_REQUEST to use in HTTP_RESPONSE;-
when HTTP_REQUEST {
set fSTS 0
if {[string tolower [HTTP::host]] eq "blah.com.au"} {
Set flag for use in HTTP_RESPONSE
set fSTS 1
}
}
when HTTP_RESPONSE {
if {$fSTS} {
HTTP::header insert Strict-Transport-Security "max-age=3600"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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