Forum Discussion
abeny_894
Nimbostratus
Dec 12, 2008HTTP::uri problem
Deal all,
I have got some problems on [HTTP::uri], for example:
_________________________________________________________
http://www.foo.com/development/ --> Pool 1
...
abeny_894
Nimbostratus
Dec 15, 2008Hi Aaron,
I have modify the iRules as below and logged after enable the VS, seems the result is not expected:
Case1: http://fedora.abc.com/app1 ---> go to the port 80 and default page of app1 (web1_pool_80)
Case2: http://fedora.abc.com/app2 ---> go to the port 8080 and default page of app2 (web1_pool_8080)
Case3: http://fedora.abc.com/app3 ---> go to the port 80 and default page of app3 (pool web2_pool_80)
However, the iRules is not load balance the traffic to the pool, it seems find the exactly match path under what URI defined in the [HTTP::uri], if not match, it returns 404 page not found. It is the normal behaviour?? Thanks for your help
_______________________________________________________________
when HTTP_REQUEST {
Check the requested URI
switch -glob [HTTP::uri] {
"/app1*" {
log local0. "[IP::client_addr]:[TCP::local_port]: [HTTP::uri] matched /app1"
pool web1_pool_80
}
"/app2*" {
log local0. "[IP::client_addr]:[TCP::local_port]: [HTTP::uri] matched /app2"
pool web1_pool_8080
}
"/app3*" {
log local0. "[IP::client_addr]:[TCP::local_port]: [HTTP::uri] matched /app3"
pool web2_pool_80
}
default {
log local0. "[IP::client_addr]:[TCP::local_port]: [HTTP::uri] hit default case"
reject
}
}
}
________________________________________________________________
Dec 15 09:53:29 tmm tmm[1736]: Rule iRules_test1215 : 172.167.14.33:80: /app1 matched /app1
Dec 15 09:53:37 tmm tmm[1736]: Rule iRules_test1215 : 172.167.14.33:80: /app2 matched /app2
Dec 15 09:53:45 tmm tmm[1736]: Rule iRules_test1215 : 172.167.14.33:80: /app3 matched /app3
Dec 15 09:53:51 tmm tmm[1736]: Rule iRules_test1215 : 172.167.14.33:80: /sales hit default case
_____________________________________________________________
FYI, if i use [HTTP::host], no such problem found and it can successfully load-balance to the said pool.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
