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.
2 Replies
- Sanjeev_126346
Nimbostratus
guys to be more clear with the request.
I need to add below, depending on the host i get request from . I have to 2 host pointing to same VIP.
when HTTP_RESPONSE { HTTP::header insert Strict-Transport-Security "max-age=3600" }
- IheartF5_45022
Nacreous
You 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