Forum Discussion
Virtual Server with two sites but same IP
- Aug 16, 2022
Hi yxorpesrever ,
Below is the ref LTM policy which will be useful for your use case. You need to add another rule under same policy for other domain. Likewise you can add multiple rules to forward traffic to the desired pools based on matching the hosts under same LTM policy. Once policy is ready, you need to map it on the desired vServer.
(I found one video on youtube which is having same senario explained using iRule. Just in case you need some more references to acheive it. Refer this youtube video if needed.)
For the SSL certificate query - If you have *.abc.com wild card cert being used on the vServer then for the rest sites coming under *.abc.com domain should be fine with it. (city.abc.com, stat.abc.com etc). If you have sites which is having different domains or you have cert for specific FQDN only, then you need to make sure to have specific SSL certificates for the specific domain and/or FQDN to be used on the vServer else you will get cert mismatch error. In this senario, your vServer will have multiple client-ssl profiles on the vServer and one of the client-ssl profile will act as default/fallback client-ssl profile. Please refer this article for more details on it.
One query - As you are saying you have same internal/backend servers for both sites, so are they running on different ports or services?
Hi yxorpesrever
As per my understanding, you need to have two different sites/urls running on the single virtual server and you have separate pool to serve these sites. If that so, you should be able to achieve your use case using LTM policy as well as irule.
You need to set condition like,
If traffic coming for host - city.abc.com --> Forward Traffic to pool-city.abc.com &
If traffic coming for host - stat.abc.com --> Forward Traffic to pool-stat.abc.com
Sample iRule is for your ref.
when HTTP_REQUEST
{
switch [HTTP::host] {
"city.abc.com" {pool pool-city.abc.com}
"stat.abc.com" {pool pool-stat.abc.com} }
}
If you have same pool for both urls/sites. You need to manage this on application side.
Hope it helps!
- yxorpesreverAug 15, 2022Altostratus
Ooooo okay that's starting to make some sense. I believe you understand it right, or at least based on my description of the issue, which could be bad LOL.
but yes, it's the same external IP, internal IP, same VS. I did create a new pool and added the same server to the members since they both reside on the same.
With the LTM policy, would you be able to expand on that a bit for me? Or is that referring to the iRule?
Thank you!
Edit: I feel like I am leaving something out. city seems to work just fine, but stat doesn't seem to go anywhere. Would that maybe be tied to an ssl cert that needs to be attached to the server? If any of my stuff comes across as dumb, I'll be honest with you that it's probably because I am. Kinda got tossed into a situation and here we are! It's all good though.
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