Forum Discussion
Using F5 as a proxy between two websites
Hello Devcentral,
I’m trying to set an IRule to act as a proxy between two websites without changing the URL in the user’s browser.
When user goes to
https://www.site1.com/test
The F5 should go to https://www.site2.com/test and reply to the user (as I said without changing the URL in his browser).
I tried this syntax but it doesn’t seem to be working:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/test" } {
HTTP::header replace Host "www.site2.com"
}
}
Can you please advise me what am I doing wrong here?
Tnx, Yaniv.
15 Replies
- What_Lies_Bene1
Cirrostratus
You're welcome. You needed to specify the virtual as otherwise the traffic would be just be sent to the Pool Members in the default Pool configured for the original Virtual the iRule is applied to and these of course don't host the site2 content; the Pool Members of the site2 VS do. Changing the header alone won't get the traffic to the right place. - Yaniv_93956
Nimbostratus
I see, and what if site2 was not hosted by the F5?
(Suppose it was a physical server).
Would it work without the addition?
Yaniv. - What_Lies_Bene1
Cirrostratus
If you created a Pool with the site2 servers in it and then sent the traffic to it using the pool command rather than the virtual command that would work. Either way you would have to specifically route the traffic to the correct place unless site1's Pool Members were also hosting site2. - Yaniv_93956
Nimbostratus
I understand,
I appreciate all your help, thanks again.
cheers, Yaniv. - What_Lies_Bene1
Cirrostratus
Great. You're very welcome. Cheers
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