Forum Discussion

KJ_50941's avatar
KJ_50941
Icon for Nimbostratus rankNimbostratus
Oct 16, 2015

pool selection base on Browser and Linux server requests?

I was trying to make this work however unsuccessful so far, it works only if request comes from IE or Firefox but fails of request s from Linux server. Thank you

 

in short I am trying to select pool members if request comes from linux send it to pool 1 other wise send to pool 2.

 

below Irule didn't work for linux server requested.

 

when HTTP_REQUEST { switch [string tolower [HTTP::host]] { "example.com" { switch -glob [string tolower [HTTP::uri]] { "/test" { pool test-Apache_SAT_9443_Pool } "/my" { pool my-Apache_SAT_9443_Pool } default { pool Apache_SAT_8443_Pool } } } }

 

}

 

I also tried below irule no help either.

 

when HTTP_REQUEST { set lowercaseuri [string tolower [HTTP::uri]] switch -glob $lowercaseuri { "/test" { HTTP::redirect "https://example.com[HTTP::uri]" } "/my" { HTTP::redirect "https://example.com[HTTP::uri]" } } } }

 

Thank you.

 

2 Replies

  • Confused what you are trying to do, your iRule is selecting a pool based on the URI of the HTTP Request and not looking for anything to identify the client's OS.

     

    If you are looking to identify the client's OS or browser need to look at the User-Agent string HTTP header in the request.