Forum Discussion
tabkad_89844
Nimbostratus
Aug 21, 2011irule for port redirection based on Domain names
I have a webserver listening on multiple ports for different urls.
I have made an irule to start with;
I have a webserver listening on multiple ports for different urls.
I have made an irule to start with;
when HTTP_REQUEST {
if {([HTTP::host] eq "abc.com") } {
pool pool_abc
} elseif {([HTTP::host] eq "xyz.com") } {
pool pool_xyz
} elseif { ([HTTP::host] contains "*.abc.com") } {
pool pool_allstar_abc
} elseif {([HTTP::host] contains "*.xyz.com") } {
pool pool_allstar_xyz
}
}
My problem is that the wildcard does not work if there is a request coming from *.abc.com. Each pool is representing different ports in my configuration. Any experts inputs will be highly appreciated.
- The_Bhattman
Nimbostratus
Hi tabkad,
I hope this helpswhen HTTP_REQUEST { switch -glob [string tolower [HTTP::host]] { "abc.com" { pool pool_abc} "xyz.com" { pool pool_xyz } "*.abc" { pool pool_allstar_abc } "*.xyz.com" { pool pool_allstar_xyz } } }
- tabkad_89844
Nimbostratus
Hi Bhattman, - Brian_Deitch_11Historic F5 AccountOn the http profile, set redirect rewrites to matching.
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