Forum Discussion

JAIME_QUIROGA_1's avatar
JAIME_QUIROGA_1
Icon for Nimbostratus rankNimbostratus
Sep 08, 2014

MODIFY URI WITH IRULE

Hi

I need to help me with an Irule that doesn't change the URI that client send.

when HTTP_REQUEST {

switch -glob [string tolower [HTTP::uri]] { 

    "/swscersalud*" {         
        pool Pool_Consorcio_test
        HTTP::uri "/Services/Utility/certificacionSalud/WS/Implementation/Service.serviceagent/WSCERSALUDSoapEndpoint"
        }
    "/wsconadmo*" {
        HTTP::uri "/Services/Utility/OyS/WS/Implementation/WSCONADMO.serviceagent/OySSoapEndpoint"
        pool Pool_Consorcio_test_V2
    }

    "/wscomeps*" {
        log local0. "Incio wscomeps[HTTP::uri]"
        pool Pool_Consorcio_test_V3
        HTTP::uri "/Services/Utility/siam/WS/Implementation/WSSIAM.serviceagent"
        log local0. "Cambio wscomeps [HTTP::uri]"
    }

    "/wssispos*" {
        log local0. "Incio wsispos [HTTP::uri]"
        pool Pool_Consorcio_test_V4
        HTTP::uri "/Services/Utility/serviciosAportes/WS/Implementation/WSSISPOS_ServiciosAportes.serviceagent"
        log local0. "Modifico wsispos [HTTP::uri]"
    }
}

}

when HTTP_REQUEST_SEND { switch [LB::server addr] { "10.237.146.1" { clientside { HTTP::header replace Host "vmpesbserver:14005" } } "10.237.146.2" { clientside { HTTP::header replace Host "vmpesbserver2:14005" } } }

}

In adition i need that the Irule identify the server and modify the hostname, but if the client send "/swscersalud" the port is 14000, if the client send "/wsconadmo" the port is 14003, if the client send "/wscomeps" the port is 14004 and if the client send "/wssispos" the port is 14005.

The LTM has version 10.2.4

3 Replies

  • If your pools are configured on the different ports i don't see any issues with that irule.

     

    Although, i don't think you need to have the port number when you send the host header.

     

    What happens to the traffic when you do it?

     

  • You haven't said what's wrong.

     

    There's known issue where if you change a URI via HTTP::uri, the change won't be reflected by calling [HTTP::uri] immediately afterwards, although it has been updated when sent to the server...perhaps this is making you think that your rule is not working? I think the issue applied to 10.2.4 although I an unable to find any reference to it offhand.

     

    Are vmpesbserver/vmpesbserver2 valid hosts on the destination server? Or should they be FQDN?

     

    • JAIME_QUIROGA_1's avatar
      JAIME_QUIROGA_1
      Icon for Nimbostratus rankNimbostratus
      OK thanks for your answer, What is the proper method to change the URL?. Yes I think that Irule is failing, because the application is not right, I took traffic capture and I saw that the URI is not change. In the irule i need to modify the FQDN in the pool member for app operation right.