Forum Discussion
Robert_77728
Nimbostratus
Sep 25, 2012Problem with HTTP_RESPONSE for a certain host or pool
I'm trying to filter the HTTP_RESPONSE to only work with a certain host or pool. I'm getting an error saying "[HTTP::host] cannot be used with HTTP_RESPONSE". My question is how can I filter this iRule to only work with a certain host or pool? Thank you for your time... I'm a newbie!
version 10.2.2
when HTTP_RESPONSE {
if {[HTTP::host] contains "test.nowhere.com"}{
if {[matchclass [HTTP::header Content-Type] equals $::pdf_reports]}{
HTTP::header replace Cache-Control "max-age = 60"
}
}
}
- Mohamed_Lrhazi
Altocumulus
Access HTTP::host in the HTTP_REQUEST event and save it to a variable for use in the HTTP_RESPONSE event. - Robert_77728
Nimbostratus
I did and HTTP::host is listed but I'm getting the error saying it's not allowed. - What_Lies_Bene1
Cirrostratus
This one should do the trick: https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2161531/showtab/groupforums/Default.aspx. Looks pretty simple. - Robert_77728
Nimbostratus
That worked great! Thanks "What Lies Beneath"!!! - What_Lies_Bene1
Cirrostratus
You're welcome. Btw, how did you mark the topic as solved? I need to do that with a few questions of my own. - What_Lies_Bene1
Cirrostratus
Don't worry, I've worked it out.
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