Forum Discussion
sam_111661
Nimbostratus
Aug 05, 2008Default vhost using iRule
I'm trying to create an iRule that would behave as the default virtual host on apache, the reason is that the default virtual host on apache points to different URL. We have around 2000 DNS names pointing to one virtual IP, 500 out of these are fake and are supposed to be redirected on the bigip to the default page "http://www.default-page.com". I don't want to match the fake addresses in the iRule as the customer wants to have the option of creating a temporary DNS record and pointing it to the VS, this should be automatically redirected to the default page without any modification to the bigip class or apache configuration.
I have created a class called host_real and the following iRule:
class host_real {
"www.page1.com"
"www.page2.com"
"..."
}
when HTTP_REQUEST {
if { [ matchclass [HTTP::host] equals $::host_real ] } {
pool apache_pool
} else {
HTTP::redirect "http://www.default-page.com"
}
}
I haven't tested it yet and the question is whether this is the best way to achieve this and whether it is safe (from the performance point of view) to have a class with around 1500 URLs in bigip.conf
Many thanks in advance
No RepliesBe the first to reply
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