Forum Discussion
Stephen_Swali_8
Jan 17, 2008Nimbostratus
iRule to change host headers.
Hi guys,
first time on DC so apologies in advance if I'm doing something wrong.
Please can you help with an issue I have.
We have a website that is hosted externally on a...
Stephen_Swali_8
Jan 17, 2008Nimbostratus
Hey Aaron.
thanks for the response.
I'm not sure I'm clear with what you're explaining in regard to the stream config.
I think I've got the request and response rules correct (but would appreciate your view on this - pls see below for rules) but I think you're suggesting I need to look at creating a stream profile too and then I think using that stream profile in the response iRule, is this correct?
request irule.
when HTTP_REQUEST {
if { [HTTP::host] equals "www.mycompany.co.uk"} {
HTTP::header replace "Host" "www.provider.com"
}
}
response irule.
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "3" } {
HTTP::header replace Location [string map -nocase {www.provider.com www.mycompany.co.uk} [HTTP::header Host]]
}
}
thanks,
Steve.
- trx_94323Nov 23, 2016Nimbostratus
Hello Steve, I'm looking to do something similar. The jist of it is we are trying to mask a external domain name on the front end, but intercept it from the F5 and replace the internal domain name to the back-end server, and when it comes back it preserves the masking external domain.
Did you or anyone do the something similar? Sharing the code snippet is fully appreciated.
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