For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Yaniv_93956's avatar
Yaniv_93956
Icon for Nimbostratus rankNimbostratus
Jan 21, 2013

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

  • 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.
  • 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.

     

  • 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.
  • I understand,

     

    I appreciate all your help, thanks again.

     

     

    cheers, Yaniv.