Forum Discussion

muratogul_64940's avatar
muratogul_64940
Icon for Nimbostratus rankNimbostratus
May 11, 2011

How to change any URI on the server side without changing orig URI

hi, how can we change URI before sending it to server (pool members) for example;

 

 

pool members IP addresses : 10.1.1.1, and 10.1.1.2

 

 

any URI comes to VIP ( http://abc.com ) ---> we need to send them to pool members as 10.1.1.1:8090/httpgw and 10.1.1.2:8090/httpgw.

 

 

nothing should change on client side only server side.

 

 

regards,

 

murat

3 Replies

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Murat,

    Are clients making HTTP/S requests directly to the virtual server? Or are they using the virtual server as a web proxy? For the former, if you want to rewrite all URIs to /httpgw without the client seeing the change, you can use an iRule like this:

    
    when HTTP_REQUEST {
    
        Check if host is abc.com
       if {[string tolower [HTTP::host]] eq "abc.com"}{
    
           Rewrite the URI to /httpgw
          HTTP::uri "/httpgw"
       }
    }
    

    If you don't want to check the host header is abc.com, you can remove the 'if' statement and the closing curly brace.

    Aaron
  • Hi Aaron,

     

     

    thank you for your interest and help.

     

     

    but i wonder this rule made changes on original URI and send it to server side like "abc.com/httpgw" but it wasn't wanted.

     

     

    server side want to see URI like 10.1.1.1:8090/httpgw, how can we do that? or possible?

     

     

    regards,

     

    murat

     

     

  • murat,

     

     

    LTM will do this as long as Port Translation is enabled, you should not need an iRule.

     

     

     

    Virtual: abc.com_http_vip

     

    Virtual IP &Por:t 192.168.1.1 80

     

    Pool: abc.com_pool

     

    Members

     

    10.1.1.1:8090

     

    10.1.1.2:8090

     

     

     

    Regards,

     

    Phillip