Forum Discussion

Nikhil_Kulkarni's avatar
Nikhil_Kulkarni
Icon for Nimbostratus rankNimbostratus
Aug 19, 2014

iRule for Reverse Proxy on the F5.

Experts, To being with I am essentially using my F5 box as a reverse proxy. I have an external facing domain, "nik.test.com".

 

When the client hits this domain this lands on a VIP configured on the F5 box(DMZ Network). Now this VIP has a iRule written which redirects the http request to "nik-int.bmc.com". This "nik-int.bmc.com" is on the internal network.

 

The iRule is working but it converts the URL from "nik.test.com" to "nik-int.bmc.com". "nik-int.bmc.com" is not resolvable externally and that causes an issue. What I need is that "nik.test.com" only fetches data from "nik-int.bmc.com" and does not convert the URL.

 

Here is the sample of the iRule:

 

when HTTP_REQUEST { HTTP::redirect "http://nik-int.test.com/media/[HTTP::uri]" }

 

Regards, Nikhil Kulkarni.

 

3 Replies

  • Instead of redirect you need to replace the host:

     

    HTTP::header replace Host "nik-int.test.com"

     

    • IheartF5_45022's avatar
      IheartF5_45022
      Icon for Nacreous rankNacreous
      I think you mean; when HTTP_REQUEST { HTTP::header replace Host "nik-int.bmc.com" }
    • LyonsG_85618's avatar
      LyonsG_85618
      Icon for Cirrostratus rankCirrostratus
      yes - i guess i should have qulified it but thought 'instead of redirect' would have made sense...