Forum Discussion

DaleLeBlanc_140's avatar
DaleLeBlanc_140
Icon for Nimbostratus rankNimbostratus
Mar 29, 2016

URI transformation

I would like to have iRule select a pool and transform the URI similar to shown below:

Client enters:

    https://www.test.com/alpha

For communication between LTM and server, I need the URI to be transformed several directories down:

    https://nodeip/random/deep/level/directory/structure

So, final result is the client only sees https://www.test.com/alpha, but the entire URI /random/deep/level/directory/structure is sent to the node.

5 Replies

  • Hello,

     

    You can use an irule to translate the client URI to the server using the following command : HTTP::uri

     

    You can also use an LTM policy to do the job

     

  • Hello,

     

    You can use an irule to translate the client URI to the server using the following command : HTTP::uri

     

    You can also use an LTM policy to do the job

     

  • Hi Dale,

    Make sure you apply Stream profile on VIP before applying below iRule.

            when HTTP_REQUEST {
            HTTP::header remove Accept-Encoding
            STREAM::disable
                }
            when HTTP_RESPONSE {
             Disable the stream filter for server responses
            STREAM::disable
             Enable the stream filter for text responses only
            if {[HTTP::header value Content-Type] contains "text"}{
            Replace 'old_text' with 'new_text'
           STREAM::expression {@https://nodeip/random/deep/level/directory/structure@https://www.test.com/alpha@}
             Enable the stream filter for this response only
            STREAM::enable
                }
            } 
    

    For reference please visit this link