Forum Discussion
taimoor_89941
Nimbostratus
May 29, 2008Need to route a URI to particular pool
Hi there
I have the following requirement and I know its achiveable on bigIP but I am not sure how to go about it. Basically, we want to use it as an intelligent router. we got a website www.abc.net/abc which is running on a webserver. What we want to do is to copy this website on a new server with minor changes, use big-ip so that www.abc.net/abc goes to the original server and www.abc.net/xyz goes to the new webserver.
Any help would be highly appreciated.
Kind regards
12 Replies
- Don_MacVittie_1Historic F5 AccountHi Taimoor,
This is pretty easily done with iRules, so I have moved your post to the iRules forums so that you can gain the benefit of the iRules experts' knowledge.
Good luck,
Don. - This should do the trick. Put your old server in pool1 and new server in pool2.
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/abc*" { pool pool1 } "/xyz*" { pool pool2 } } }
-Joe - taimoor_89941
Nimbostratus
Thanks a lot guys for your prompt replies. - taimoor_89941
Nimbostratus
Hi Guys
Sorry to bother you again. But I have a strange problem. Actually I have a question first before i come to my problem. When I create the virtual server, only one pool can be assigned to it. So how this iRule will work when it refers to two different pools, one of which is not configured in the setting.
Having said that, yesterday I gave it a go and it worked first time. This morning however, it stoped working and the websites were not loading. After some investigation I managed to find the cause. For some bizzare reason, the http profile was stoping the access to websites. I had to remove it and select none. but When I do that, I cant use iRule as it is dependant on http profile. Hence no routing. So atm I only got one website running for the server defined in the default pool.
Any ideas?
Kind Regards
Taimoor - hoolio
Cirrostratus
The rule will be evaluated. If a URI starts with /abc, pool1 will be used. If a URI starts with /xyz, pool2 will be used. If the URI doesn't match either option, the VIP's default pool will be used. You could also specify the default pool using:switch -glob [HTTP::uri] { ... default { pool pool3 }
What were the symptoms of the problem? Do you see any errors in /var/log/ltm* from the period of the failure? Were you using the exact rule Joe posted above in this thread? If not, can you post the rule you were using?
Aaron - taimoor_89941
Nimbostratus
Hi Aaron
I think I have establish that the problem I am having is not related to iRule as I have disabled it but the problem is still there. As I mentioned earlier, there seems to be some settin in the default http profile which cause this issue. As soon as I select it, websites stop working. If I leave to "none", it works fine (please refer to the file attached).
To access this website, users have to loggin to a completely different site. Once they are logged in, they click the link to reach this website (behind big-ip). The first connection is over "https" where secure token are exhanges between the servers and once authenicated, the users are directed over "http" to browse the website. It cannot be accessed directly and above process must be followed. In nutshell (according to web developer):
1) HTTPS Link on Browser page has token along with it
2) User clicks on that link
3) That link is pointing to our server page
4) Our Server pages uses the token to access a web service call
5) which validates this token and supplies data back
6) Then our server will redirect this to our home page.
This info may not related but I thought i'll post it anyway.
I first thought it could be a firewall issue but as it is working fine without http profile enabled, I am really clueless.
Help plz
Regards
Taimoor - hoolio
Cirrostratus
Can you post your VIP and HTTP profile settings? You can get this from the command line by running:
b virtual vip_name list
b profile http list
Aaron - taimoor_89941
Nimbostratus
Here are the settings as requested.
virtual seuk {
pool extweb01
destination 194.133.18.132:any
ip protocol tcp
}
profile http http {
basic auth realm none
oneconnect transformations enable
header insert none
header erase none
fallback none
compress disable
compress prefer gzip
compress min size 1024
compress buffer size 4096
compress vary header enable
compress http 1.0 disable
compress gzip memory level 8k
compress gzip window size 16k
compress gzip level 1
compress keep accept encoding disable
compress browser workarounds disable
compress cpu saver enable
compress cpu saver high 90
compress cpu saver low 75
response selective chunk
lws width 80
lws separator none
redirect rewrite none
max header size 32768
max requests 0
pipelining enable
insert xforwarded for enable
adaptive parsing enable
ramcache disable
ramcache size 100mb
ramcache max entries 10K
ramcache max age 3600
ramcache min object size 500
ramcache max object size 50K
ramcache ignore client cache control all
ramcache aging rate 9
ramcache insert age header enable
compress content type include
"text/"
"application/(xml|x-javascript)"
}
profile http http-acceleration {
defaults from http
ramcache enable
ramcache size 100mb
ramcache min object size 0
ramcache max object size 4194304
ramcache ignore client cache control all
}
profile http http-lan-optimized-caching {
defaults from http
oneconnect transformations enable
ramcache enable
ramcache size 10mb
ramcache max age 86400
ramcache min object size 0
ramcache max object size 2M
}
profile http http-wan-optimized-compression {
defaults from http
oneconnect transformations enable
compress enable
compress buffer size 131072
compress vary header enable
compress http 1.0 enable
compress gzip memory level 16k
compress gzip window size 64k
compress gzip level 1
response selective chunk
}
profile http http-wan-optimized-compression-caching {
defaults from http
oneconnect transformations enable
compress enable
compress buffer size 131072
compress vary header enable
compress http 1.0 enable
compress gzip memory level 16k
compress gzip window size 64k
compress gzip level 1
response selective chunk
ramcache enable
ramcache size 10mb
ramcache max age 86400
ramcache min object size 0
ramcache max object size 2M
}
profile http seu_http {
defaults from http
oneconnect transformations disable
header insert "X_CLIENT_IP:[IP::client_addr]"
header erase none
fallback none
response selective chunk
lws width 80
lws separator none
redirect rewrite none
max header size 32768
max requests 0
pipelining enable
insert xforwarded for enable
}
profile http seuk {
defaults from http
} - hoolio
Cirrostratus
Which HTTP profile were you using when the traffic failed? Does it now fail 100% when you test with the HTTP profile enabled?
Do you have the VIP defined on any port for a particular reason? Is the only access to the VIP made via port 80? Are there non-HTTP requests going to the VIP? If there is non-port 80 traffic going to the VIP, you could resolve the issue by configuring another VIP on port 80 with the HTTP profile and iRule enabled.
Aaron - taimoor_89941
Nimbostratus
Hi Aaron
If I understood you correctly, I have created two VIP each for http and https. I am using the default http profile. I found out that the https VIP doesnt work with http profile hence cant install the irule (as iRule require http profile) . And because the initial connection is made over https, iRule cant kickin. Is there any way I can use http profile on https VIP or any other solution I can try?
Regards
Taimoor
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