Forum Discussion

owaters_69636's avatar
owaters_69636
Icon for Nimbostratus rankNimbostratus
Oct 24, 2009

Redirect iRule Help

I am trying to redirect http://weatheri.cme.com:443 to http://datasuite.cme.com and I have been unable to figure out the right iRule for this. I was using the following iRule but this doesnt seem to do what I intended it to do. Heeeelppp!

 

 

 

when HTTP_REQUEST {

 

if { [HTTP::host] eq "weatheri.cme.com:443"} {

 

HTTP::redirect "http://datasuite.cmegroup.com"

 

}

 

}

 

 

YOur help would be greatly appreciated.

 

 

Odell
  • What is the specific behavior you're seeing? I notice the you're using :443 appended to the hostname, which is almost always associated with SSL - is the weatheri.cme.com site SSL enabled?

     

     

    -Matt
  • The site is not SSL enabled, they use port 443 as if it was a TCP port rather than an SSL handshake. So in theory the FQDN could have any port number like :443 in the FQDN. Does that help Matt?
  • Also what is happening with the iRule I pasted above is weatheri only gets redirected to datasuite when I dont use the :443 in the url, which is correct however if weatheri.cme.com has the :443 this same iRule doesnt redirect to datasuite it just sits and spins.
  • The site is not SSL enabled, they use port 443 as if it was a TCP port rather than an SSL handshake. So in theory the FQDN could have any port number like :443 in the FQDN. Does that help Matt?
  • Your redirect really does look like it should work. For example:

     
     when HTTP_REQUEST { 
     if { [HTTP::host] eq "192.168.1.100:8080"}{ 
     HTTP::redirect "http://www.python.org" 
     } 
     } 
     

    Works fine. One side note though, in case you're running into it (it doesn't look like it): if you use single ticks around your redirect location, for example 'http://www.python.org' I was able to cause a redirect loop because it was interpreted as a relative redirect and the literal string was appended onto the end of the original [HTTP::host] header:

     
     http://192.168.1.100:8080/%27http://%27http://%27http://www.python.org%27 
     

    Could you capture home headers and post them?

    -Matt

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Could you clarify what TCP port(s) clients make requests to? If the client is manually entering a port number in the address bar, the browser will attempt a TCP connection on that port. If there isn't a VIP defined on that port, the client request will time out (or "spin").

     

     

    Aaron