Forum Discussion

Jose_Loera_1179's avatar
Jose_Loera_1179
Icon for Nimbostratus rankNimbostratus
Oct 19, 2015

URL Redirect

I have a VIP that I would like to redirect to a URL that looks like this....

 

I want the user to type in the Vip IP or A record and resolved to one of the nodes in the pool similar to whats is below..

 

[host] /login.asp

 

new to iRules, so please help with this.

 

5 Replies

  • can you clarify what you are trying to do a little more. Your question is a little vague.
  • Absolutely sorry... here is what I am trying to do.

     

    I have a pool with each node having a login page example: and

     

    I also have a Virtual Server with ip example: 10.1.1.1 and I want to type in the VIP ip as followed http://10.1.1.1 and redirect it to a client node on the pool.. http://[node]/login.asp

     

    please let me know if this help

     

  • Sounds more like you want to re-write the hostname than a redirect. This iRule could do something simple like rewriting the request's host header to the IP address of the chosen pool member.

    when HTTP_REQUEST {
        HTTP::host [LB::server addr]
    }
    
    • Brad_Parker's avatar
      Brad_Parker
      Icon for Cirrus rankCirrus
      it will not "redirect" the request. A redirect sends a 301 or 302 to the client. That means they wouldn't be hitting your VIP and more. It will load balance to the select pool member and rewrite the host header to the http request to IP of the pool member. The users browser will not see the rewrite.