NielsH_187296
Mar 30, 2015Nimbostratus
Multiple virtual servers for multiple applications on one server
Hi all,
So we have a server here housing multiple webapplications, each with its respective sub-URI such as /capacity/, /track/, etc..
So we would like to create a virtual server for every application in order to manage ASM. I created the following iRule, and I logged to check if everything is set up correctly. As far as I can see, everything is set up correctly.. but i'm still not getting any response back. Suggestions?
Application 1: www-acg.bru-hub.comp.com/capacity/ Application 2: www-acg.bru-hub.com.com/track/
Desired behaviour: prod-CMS-vs --> www-acg.bru-hub.comp.com/capacity/ prod-TRACK-vs --> www-acg.bru-hub.comp.com/track/
iRule:
when HTTP_REQUEST {
set application [getfield [virtual name] "-" 2]
set pool "live-$application-pool"
if [ catch { pool "$pool" } ] {
HTTP::respond 404 content "Application pool $pool does not exist." Mime-Type "text/html"
} else {
switch "$application" {
"CMS" {
set path "capacity"
}
"TRACK" {
set path "track"
}
default {
HTTP::respond 404 content "Application $application does not exist." Mime-Type "text/html"
}
}
HTTP::uri "/$path[HTTP::uri]"
HTTP::header replace Host "www-acg.bru-hub.comp.com"
log local0. "URI is: [HTTP::uri], pool is $pool, host is [HTTP::host]"
pool "$pool"
}
}
Any suggestions or solutions are greatly appreciated. Thank you!