Forum Discussion
Robert_47833
Aug 08, 2011Altostratus
questions on HTTP::header replace Host
Hi,dear irule
I have 2 datacenters,due to some operation,we need to forward traffic on site1 to site2
site1 and site2 have the same domain name www.cjj.com
However ,they can be different in order to achieve goal of forwarding traffic
like www1.cjj.com ,www2.cjj.com(I can change something to achieve this)
for example ,clients visit www.cjj.com and hit site1,when bigip receive this traffic ,forward it to site2 and keep the broswer same as before.
how to achieve this?
I searched the irule here,HTTP::header replace Host are used more often than other methods
But I am confused by events below
when HTTP_REQUEST {
if { [HTTP::header host] eq "www.cjj.com" } {
HTTP::header replace Host "www2.cjj.com" }
}
when HTTP_RESPONSE {
if { [HTTP::header is_redirect]} {
HTTP::header replace Location [string map -nocase {www.cjj.com www2.cjj.com} [HTTP::header value Location]] }
}
Here is my doubts:
1:why should we use HTTP_RESPONSE to change the location?
2:should I set node xxx under HTTP::header replace Host "www2.cjj.com"
like
HTTP::header replace Host "www2.cjj.com"
node xxxxip xxport
3:what is the process of this command ,after excuting this replace,what is the behavior of bigip to handle traffic(I know http::redirect is bigip send 30x to client and the client send request to new URL )
4:how to achieve this goal :forward traffic which hit site1 to site2 ,can I not need two domain name to achieve this?
Thanks in advance
- The_BhattmanNimbostratusHi Jucao,
- Robert_47833AltostratusHi,Bhattman,good to see u again
- Robert_47833Altostratuswhen HTTP_RESPONSE {
- Robert_47833AltostratusHi,I want a irule to proxy site2 via site1
- nitassEmployee2:sorry for my bad understanding,you mean
- Robert_47833AltostratusHi,
- Robert_47833AltostratusI want to redirect to site2 and keep the old url in browser
- Robert_47833AltostratusHi,friends
- hooleylistCirrostratusNo, that's not possible in HTTP. You can either update the browser with a redirect or rewrite the request and send it through LTM to a destination.
- Robert_47833AltostratusThanks,Aaron
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