Forum Discussion
Dominique_10413
Nimbostratus
Mar 10, 2009iRule to route https traffic to different pool based on hostname
We have a rather urgent requirement to route HTTPS traffic to two different hosts based on the hostname that was requested.
Effectively what we need to do is have 1 public IP address (linked to a virtual server); to which all traffic is directed. If the request is for one.domain.com route it to http_server_one and if the request is for two.domain.com route the request to http_server_two.
SSL termination can be handled by either the LTM or the HTTP Server.
We are running BIG-IP 9.1.2 Build 40.2
Any advice would be helpful.
Thank you
Dominique
9 Replies
Sort By
- hoolio
Cirrostratus
Hi Dominique, - Dominique_10413
Nimbostratus
Hi Aaron, - hoolio
Cirrostratus
The crucial thing is to have a single cert which is valid for both domains. For all practical scenarios you can only support one cert per virtual server. So you either need a single cert valid for both domains or you need to change the DNS so that the two domains resolve to separate IP addresses. You can check the other post I referenced for additional details. - Dominique_10413
Nimbostratus
Thank you for the reply. I was hoping to avoid the full blown explanation but think it might paint a clearer picture. - hoolio
Cirrostratus
From the LTM perspective, if you want to be able to specify that requests with a host header for site1.com go to one pool of web servers and requests for site2.com go to a second pool of web servers, you need to either: - Dominique_10413
Nimbostratus
Thanks Aaron, appreciate your feedback. - hoolio
Cirrostratus
If you do end up going with option one, you can use HTTP classes in 9.4+ or an iRule to select the pool based on the requested host header. For details on using HTTP classes, you can check the LTM configuration guide for your version. Here is an example iRule:when HTTP_REQUEST { Check requested host header (set to lowercase) switch [string tolower [HTTP::host]] { "www.site1.com" { pool site1_pool } "www.site2.com" { pool site2_pool } default { pool default_pool } } }
- James_Richter_1
Nimbostratus
Related to this, we have about 80+ sits all using the same Virtual Server that we're doing with host headers. Currently we're using http profiles to route them to the correct Pool, but I wonder if we wouldn't be better off with this iRule instead. Does anyone know if there is a performance improvement either way with so many sites? - hoolio
Cirrostratus
Hi jrichter,
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