Forum Discussion

john_miller_440's avatar
john_miller_440
Icon for Nimbostratus rankNimbostratus
Nov 09, 2006

simple irule for redirection

hello everyone,

 

I am trying to take a request from some port just add a "default" url to it. the virtual server is http://1.1.1.1:80

 

 

any requests to that address should go to http:2.2.2.2:4950/apps/index.html

 

 

I guess I dont need a pool for that, though I have one setup. but is this an irule? or is there another way to do that? when I tried somehthing like:

 

 

when HTTP_REQUEST {

 

 

HTTP::redirect http://10.201.119.4:4040/ftputil/index.jsp

 

 

}

 

 

I got this error:

 

01070394:3: HTTP_REQUEST event in rule (IA_Load_Util_Redirect) requires an associated HTTP or FASTHTTP profile on the virtual server (IALOADUTIL_QA).

 

 

thanks for any suggestions!!

 

 

John
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    The rule looks fine. Just add an HTTP profile to your virtual server under the VIP properties page. The default HTTP profile should work fine for this.

     

     

    Aaron
  • thanks, that was it..yes I'm a newbie with irules..

     

     

    What about goinyg through the F5 instead of a redirect?

     

    with a VIP and some pool members, I'd just want to append the /app/index.html onto the pool members ip:port

     

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    You can use HTTP::uri to view or modify the URI before the request is sent to the node.

    Here is one example:

    
    when HTTP_REQUEST {
       if { [HTTP::uri] equals "/" }{
          HTTP::uri "/app/index.html"
       }
    }

    This rule with trigger when a client makes an HTTP request. If the client requested the root document (/), the rule would rewrite the URI of the request to /app/index.html. The VIP's load balancing algorithm would handle the node selection so you don't have to worry about it within your rule.

    If you want more info on the HTTP::uri options try checking the wiki (Click here)or search the forum for URI rewrite.

    HTH,

    Aaron
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Maybe I missed something there. Are you wanting to rewrite the URI and redirect clients to another host or IP address? Or are you trying to modify the URI the client requests and pass it directly to the node without sending a redirect back to the client? Or something else?

     

     

    Thanks,

     

    Aaron