Forum Discussion
Thiago_Morais
Altostratus
Hi Daniel,
Thank you for your reply.
I got more details about the request that the application will handle.
External URL: https://url1.domain.com:10002/coreService/services
Internal URL: https://url2.domain.com:10002/coreService/services
In that case, I am thinking to use an iRule to rewrite the HTTP::host from url1.domain.com to url2.domain.com in the HTTP_REQUEST and HTTP_RESPONSE?
What do you think about it?
Regards,
TM
Daniel_Wolf
Feb 04, 2021MVP
Hi Thiago,
I would use a LTM Traffic Policy instead on an iRule and also I would pay attention if maybe you want to rewrite the Referer header too.
In a Traffic Policy you would do it like this (tmsh output)
ltm policy policy_route_url1.domain.com {
controls { forwarding server-ssl }
requires { http }
rules {
match_url1.domain.com {
actions {
0 {
http-host
replace
value url2.domain.com
}
1 {
http-referer
replace
value "tcl:[regsub -nocase {url1.domain.com} [HTTP::header Referer] {url2.domain.com}]"
}
2 {
forward
select
pool pool_url2.domain.com
}
}
conditions {
0 {
http-host
host
values { url1.domain.com }
}
}
}
status published
strategy first-match
}
KR
Daniel