Forum Discussion
eLeCtRoN
Cirrus
Aug 22, 2018iRule HOST Header replace with dynamic content
Hello,
I have just a short question, is it possible and how to change the HOST Header.
For example I come from admin.test1.mycompany.com and I would like to change it
to admin.test2.mycompany.co...
Lee_Sutcliffe
Nacreous
Aug 22, 2018I’ve written this on my phone so apologies if it’s not 100% correct as I’ve not tested it. This example will take the first field of the Host header up to th first “.” Which in your example is admin, but it could be anything. It then replaces the host header using the test2 host and adding the dynamic first field.
when HTTP_REQUEST {
set hostField [getfield [HTTP::host] “.” 1]
HTTP::header replace "Host" ${hostField}.test2.mycompany.com
}
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