Forum Discussion

lipos_54863's avatar
lipos_54863
Icon for Nimbostratus rankNimbostratus
Mar 26, 2012

Secret HTTP redirection

Hi,

 

 

I need to hide HTTP redirection on LTMs using an iRule.

 

 

Here's my simple example:

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] starts_with "/test"} {

 

HTTP::redirect "http://xx.xx.xx.xx/test"

 

log local0. "Enabling redirection for HTTP: [HTTP::host][HTTP::uri]"

 

}

 

}

 

 

In an effect I don't wan't to see http://xx.xx.xx.xx/test in my address but I want to cover it with a domain that this request was forwarded to originariginally.

 

 

In summary:

 

1. I'm sending request to VIP of test.com - it's being forwarded to the POOL. My broswers shows that I'm browsing tes.com. All as usual.

 

2. I'm sending request to VIP of test.com/test - it's being forwarded to on IP not behind the F5s. My broswers shows that I'm browsing test.com/public

 

 

I can't use "node" ot "pool" because these IP in not behind the F5s but rather in the Internet.

 

Can someone give me any idea or example of code that does it?

 

Maybe there's a function of iRule that takes care of it?

 

 

Let me know what you think!

 

M

 

  • You can change a users path so that the server gets a different request than the user originally sent, but this only works for servers behind your LTM...a redirect is just that, a redirection. I don't know of any way to do this.
  • You can load balance to anything that LTM can route to. If you can use static IP address(es) for the external content you can use a pool. Just SNAT the traffic and create a route. If you need to resolve a hostname to an IP address, you can use the RESOLV::lookup command to resolve the hostname and the node command to select it as the destination IP.

     

     

    https://devcentral.f5.com/wiki/iRules.resolv__lookup.ashx

     

     

    Aaron
  • Posted By Brian on 03/26/2012 07:39 AM

     

    You can change a users path so that the server gets a different request than the user originally sent, but this only works for servers behind your LTM...a redirect is just that, a redirection. I don't know of any way to do this.

     

    You mean using HTTP::uri?

     

     

    I agree that redirection is the normal way to do it but I'm forced to investigate solving my problem without affecting the solution and how described above.

     

     

    Any ideas are welcome!

     

  • Posted By hoolio on 03/26/2012 07:48 AM

     

    You can load balance to anything that LTM can route to. If you can use static IP address(es) for the external content you can use a pool. Just SNAT the traffic and create a route. If you need to resolve a hostname to an IP address, you can use the RESOLV::lookup command to resolve the hostname and the node command to select it as the destination IP.

     

     

    https://devcentral.f5.com/wiki/iRules.resolv__lookup.ashx

     

     

    Aaron

     

    Hm.. you are right I will use SNAT!