Forum Discussion
John_Glass_3854
Sep 13, 2006Historic F5 Account
Modification of http response header when using HTTP::redirect
Hello,
I think I'm trying to do something very basic - redirect all HTTP traffic for a given virtual address to the HTTPS virtual server. I found SOL3847 at Ask F5, which appeared to be exactly what I was looking for. (I'm running 9.2.2)
rule redirector {
This iRule redirects all HTTP traffic to
the SSL virtual. From tech.f5.com SOL3847.
when HTTP_REQUEST {
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
The issue is that using this rule alone results in an HTTP response header being sent back to the client indicating:
"Server: BIG-IP"
I would like to replace "BIG-IP" with "Company Name". Usually, I accomplish this via:
when HTTP_RESPONSE {
HTTP::header replace Server "Company Name"
}
However, it appears as though the HTTP_RESPONSE test is not being met when the redirect is issued directly from the BIG-IP.
Is there a way to replace the Server response header in iRules - or is that a potential stream profile candidate?
Finally, the redirect issued is a 302. Any idea why a 301 is not being sent for what is effectively a permanent situation?
Thanks,
InfoMonkey
- I don't believe you can override the header values in the HTTP::redirect command. But, you can always use the HTTP::respond command to send back any respond code you wish. And, that command allows you to add headers.
when HTTP_REQUEST { HTTP::respond 302 Location "http://www.domain.org" "Server" "Company Name" }
- With this request:
- Deb_Allen_18Historic F5 AccountThanks for that, I'll include in the casenotes.
- John_Glass_3854Historic F5 AccountDeb and Joe - thanks for taking this on.
- bl0ndie_127134Historic F5 Account
- John_Glass_3854Historic F5 AccountI've entered a case at websupport.f5.com on this issue.
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