Forum Discussion
Troubleshoot iRule for HTTP header rewrite
I am not a iRule expert 🙂
What the client wants is that, if the client browse https://cv89ppen.hrms.com, it will be forwarded to cv99pp.hrms.com/psp/CV89PP/?&cmd=login&languageCd=ENG.
or if the client browse https://cv89ppfr.hrms.com, it will be forwarded to cv99pp.hrms.com/psp/CV89PP/?&cmd=login&languageCd=CFR.
or if the client browse cv89pp.hrms.com, it will simply append "/CV89PP/signon.html".
The virtual server does the SSL offloading.
For any reason, only the append part worked. Nothing happened when client browse https://cv89ppen.hrms.com/ and https://cv89ppfr.hrms.com, and it even won't leave the logging information.
Can anybody take a look? Below is my iRule.
Thanks.
====================================================================================
when HTTP_REQUEST {
log local0. "Client [IP::client_addr] is accessing [HTTP::host][HTTP::uri]"
if {[HTTP::uri] equals "/"} {
switch -glob {string tolower [HTTP::host]} {
"cv89ppen.hrms.com" {
HTTP::header replace Host "cv99pp.hrms.com"
HTTP::uri "/psp/CV89PP/?&cmd=login&languageCd=ENG"
log local0. "Client [IP::client_addr] is redirected to [HTTP::host][HTTP::uri]"
}
"cv89ppfr.hrms.com" {
HTTP::header replace Host "cv99pp.hrms.com"
HTTP::uri "/psp/CV89PP/?&cmd=login&languageCd=CFR"
log local0. "Client [IP::client_addr] is redirected to [HTTP::host][HTTP::uri]"
}
"cv89pp.hrms.com" {
HTTP::uri "/CV89PP/signon.html"
}
}
}
}3 Replies
- Arie
Altostratus
Is the iRule assigned to both VIPs (port 80 and 443)?
- XINGYU_99486
Nimbostratus
No it only applied to VIP on HTTPS.
The VIP on HTTP simply redirected to HTTPS.
- nitass
Employee
can you try to change from {string tolower [HTTP::host]} to [string tolower [HTTP::host]]?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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