Forum Discussion
Pete_73764
Nimbostratus
Jun 03, 2008Website redirect
Is it possible to have an Irule inspect the header and redirect based on url? For example a request comes in for www.orange.com on a vip and gets directed to its pool, but another request for www.green.com comes in on the same vip but gets redirected to another vip.
- Leo_Katona_5507
Nimbostratus
If you have just a couple of pools for one virtual server, try something like thiswhen HTTP_REQUEST { if {[HTTP::host] equals {www.orange.com}} { pool orangepool } elseif {[HTTP::host] equals {www.green.com}} { pool greenpool } else { pool other_or_no_host_header_to_this_pool } }
- hoolio
Cirrostratus
A switch would also work nicely:when HTTP_REQUEST { Select the pool based on the host header value switch [string tolower [HTTP::host]] { www.orange.com { pool orangepool } www.green.com { pool greenpool } default { pool defaultpool } } }
- Brian_Moore_603
Nimbostratus
Is the VIP_NAME only in 9.4 or higher... I am running 9.3.1 and wanted something just like this for taking xyz.net to xyz.com, also I'd like to use this on a SSL VIP, so the request comes in on a SSL VIP will the traffic run through the iRule first or through the SSL first? - hoolio
Cirrostratus
Using the virtual command to select a new virtual server for the request is a feature added in 9.4. You'd need to upgrade to 9.4+ to use 'virtual' in this manner.
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