Forum Discussion

PK_294685's avatar
PK_294685
Icon for Nimbostratus rankNimbostratus
Mar 11, 2017

HTTP URI Replace & Pool selection

Hi All,

I have an irule that Checks for incoming URI and selects a pool and replaces uri with new one.

I'm not sure what i'm doing wrong, but here is my requirement

I have a VIP with dns https://example.mycompany.com. Simple VIP with access policy that uses SAML authentication.

No pool is assigned to the VIP since i'm using irule to select the pool.

when i go to https://example.mycompany.com/abc/def/blahblah, authentication is successful and uri is changing to https://example.mycompany.com/abcdef but receiving a "connection reset" on the browser page.

FYI,

All pools are UP(members are listening on 80 or 8080).

There is no traffic details when i go to certain pool statistics.

I believe pool selection is not happening.

Any help is greatly appreciated! Thanks

Below is my iRule.
when HTTP_REQUEST {
    switch [string tolower [HTTP::uri]] {
        "/abc/def/blahblah" {
            pool abc_pool
            HTTP::uri "/abcdef"
        }
        "/UVW/XYZ/blahblah" {
            pool uvw_pool
            HTTP::uri "/UVWXYZ"
        }
    }
}
  • Use K13223 to identify RST reason.

     

    You can also include "log local0" statement to identify the pool selection and URI change within the iRule.

     

  • P_K's avatar
    P_K
    Icon for Altostratus rankAltostratus

    Thanks everyone for their suggestions. The changes I made was, I created my entire iRule under when_ACESS_ACL_ALLOWED Event and it worked!