Forum Discussion
eliezer_ramos_2
Nimbostratus
Mar 09, 2010How to use uri datagroup to forward to pool
Hi.. first time. I need to know how if doing this correctly. I'm trying to send traffic to a pool based on URI's in a datagroup. This is what I have so far:
datagroup customerservice2 contains /wrap, among other uri that are hosted out of the same pool member. Based on that I wrote this irule. Irule editor says the syntax is correct, but I may not be using the correct arguments/. Plz HELP!
when HTTP_REQUEST {
if {[ matchclass [HTTP::uri] contains $::customer_care] } {
pool p_customercare}
elseif {[ matchclass [HTTP::uri] contains $::dsm] } {
pool t_was_dsm}
elseif {[ matchclass [HTTP::uri] contains $::vendorapps] } {
pool t_vendorapps}
elseif {[ matchclass [HTTP::uri] contains $::pts] } {
pool p_pts}
elseif {[ matchclass [HTTP::uri] contains $::customerservice2 ] } {
pool p_customerservice2}
}
11 Replies
- hoolio
Cirrostratus
The syntax and logic look fine. Have you had a chance to test it?
Aaron - eliezer_ramos_2
Nimbostratus
Yes.. I did, but I get a 404. Do I need to include the forward slash in the data group? e.g. /customerservice. I created the uri data group as string, is that correct?
Thanks
Eli
"edit" I tried both, with and without the "/" and still nothing. - hoolio
Cirrostratus
Which LTM version are you running? If you add logs to the iRule can you check which cases are matching?when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] request to [HTTP::uri]" if {[ matchclass [HTTP::uri] contains $::customer_care] } { log local0. "[IP::client_addr]:[TCP::client_port]: Matched customer_care" pool p_customercare} elseif {[ matchclass [HTTP::uri] contains $::dsm] } { log local0. "[IP::client_addr]:[TCP::client_port]: Matched dsm" pool t_was_dsm} elseif {[ matchclass [HTTP::uri] contains $::vendorapps] } { log local0. "[IP::client_addr]:[TCP::client_port]: Matched vendorapps" pool t_vendorapps} elseif {[ matchclass [HTTP::uri] contains $::pts] } { log local0. "[IP::client_addr]:[TCP::client_port]: Matched pts" pool p_pts} elseif {[ matchclass [HTTP::uri] contains $::customerservice2 ] } { log local0. "[IP::client_addr]:[TCP::client_port]: Matched customerservice2" pool p_customerservice2 } }
Aaron - eliezer_ramos_2
Nimbostratus
I'm running 9.3.1... I'll give that a try.
Thanks
Eli - eliezer_ramos_2
Nimbostratus
Hi.. this is what I found in the local traffic log..what I'm I looking for?
Wed Mar 10 10:24:25 EST 2010 tmm tmm[1133] Rule inappqa6 HTTP_REQUEST: 10.122.30.68:1140: GET request to /wrap
Wed Mar 10 10:24:25 EST 2010 tmm tmm[1133] Rule inappqa6 HTTP_REQUEST: 10.122.30.68:1140: Matched customerservice2
Wed Mar 10 10:24:28 EST 2010 tmm tmm[1133] Rule inappqa6 HTTP_REQUEST: 10.122.30.68:1140: GET request to /wrap/
Wed Mar 10 10:24:28 EST 2010 tmm tmm[1133] Rule inappqa6 HTTP_REQUEST: 10.122.30.68:1140: Matched customerservice2 - hoolio
Cirrostratus
So that log shows the parsed URI was /wrap and the request was sent to the customerservice2 pool. /wrap/ was then requested and went to the same pool.
Do the servers in the customerservice2 pool serve content for /wrap? If you make a request directly to one of the servers in that pool, do you get a 404 or a 200 with the correct content?
Aaron - hoolio
Cirrostratus
The 404 probably means that the request is going to a pool member which doesn't serve content for that URI or the server doesn't recognize the request.
If you've confirmed that the pool member being selected is correct, can you check whether the server expects a particular hostname in the requests in order to process the request using the correct virtual host?
Is there anything different in how you're making a request to the VIP which works and this one that doesn't?
Aaron - eliezer_ramos_2
Nimbostratus
Well... guess what? I contacted the websphere servers admin and he needed to add something to the servers to allow the ltm to talk to them... Thanks for all your help.
Eli - What did the admin have to add? Back to Hoolio's ?, was it ever serving a content at that uri?
I'm not to familiar with IBMs websphere, but I do know they have some sort of domain security they use.. - eliezer_ramos_2
Nimbostratus
this is what they did.. "(virtual host definitions on websphere side need to be updated to include inappqa6.fpl.com for the incoming requests to be identified and served by backend WebSphere JVMs to route it applications)"
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
