Forum Discussion

Ramesh_GK_75103's avatar
Ramesh_GK_75103
Icon for Nimbostratus rankNimbostratus
Oct 27, 2008

Need help on HTTP Rewrite Rule

Hi,

 

 

Can somebody help me with the iRule that does the following.

 

 

I have 2 physical servers running 2 web servers running on 80 and 8080 on each node.

 

 

http://www.domain.com goes to default http://www.domain.com/

 

http://www.domain.com/web should rewrite the URL to http://www.domain.com:8080/intranet and it should rewrite it again back in the responses also along with session persistance and cookie.

 

 

Thanks in advance.

 

GK

 

4 Replies

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus
    Wouldn't it be easier (and cleaner) to create a subdomain (e.g. intranet.domain.com)?
  • Yes it is but it is mandatory that we need to have a single dns name for all the web components
  • Rather than an iRule you could use HTTP Classes to select the pool (so you need two separate pools, on one 80 the other on 8080) based on URI content and also rewrite it (this will be transparent to the user), applying the default cookie persistence profile will then persist the users as you desire.

     

     

    If you want to apply different persistence profiles for each service, you can still use HTTP classes and an iRule to choose the persistence profile triggered by the HTTP_CLASS_SELECTED event.

     

     

    Thanks,

     

     

     

    Scott-
  • Else, it looks like the proxypass iRule that Kirk wrote would work for this scenario:

     

     

    ProxyPass (Click here)

     

     

    Aaron