Forum Discussion
Multiple service on same FQDN
Hi,
I have a doubt. We need to do something like this: We have an domain: we need that if a user put this direcction in his/her browser, the F5 send it to a server x.x.x.x, but if the user put www.example.com/something the F5 should sent it to a y.y.y.y server.
Is this possible?
Thanks in advance.
4 Replies
- OTS02
Cirrus
Perhaps make two pools, and apply an iRule like this:
when HTTP_REQUEST { set uri [string tolower [HTTP::uri]]
if { $uri equals "/" } {
pool NOTHING_BUT_Xs
}
else {
pool NOTHING_BUT_Ys
}
}
- Arie
Altostratus
OTS02's suggestion will work, but you have to consider other resources that are likely included. For instance, where are images, scripts, style sheets etc located?
In general, you may want to have a default server and a server for exceptions (e.g.
). If possible, have the site owner use the subfolder for supporting files (images, style sheets, scripts) where that makes sense./somethingIt can get tricky if you're using dynamic resources that require persistence even though they are hosted in different 'folders'. For instance, some .NET applications use
for dynamically generated resources (e.g. images). If the page under/websource.axd
instructs the client to request/something
you'll have to add some intelligence to the iRule to ensure that the request isn't routed to the other pool./webresource.axdAlso, consider that pages (especially the home page) can be called in a variety of ways. For instance, the home page could be
,/
,/index.html
,/default.aspx
, etc./index.phpLastly, you'll probably want to use
instead ofHTTP::path
as the latter includes the query string parameter, which would have an effect on the string comparison you'd be doing to route the request to the proper pool.HTTP::uri - Arie
Altostratus
@Beinwin - without knowing what kind of application you're hosting and on which platform I can't determine what kind of challenges you may run into.
However, I would start by catching all traffic to
and routing that to the pool for it. Set the default pool for the VIP to the pool for/something
. That should get you mostly there. Keep in mind that by doing that the VIP will be marked down if there's a problem with the pool for/
, even if the pool for/
is perfectly fine./something - Yoann_Le_Corvi1
Cumulonimbus
Hi,
I like iRules too, but I honestly think the best approach for you is the LTM Policies... For example, define the default pool on your VS (the one where requests NOT matching the "/something" go), and define an LTM Policy searching for the matching HTTP URI, and in action send to the right pool for that URI.
No line of code required :)
Sincerely
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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