# Multiple Website on one VIP

**URL:** <https://community.f5.com/t/multiple-website-on-one-vip/3853>\
**Category:** Technical Forums\
**Tags:** irules, devops, application-delivery\
**Created:** [June 17, 2014, 12:01pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853 "2014-06-17T12:01:06Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wasim\_Hassan\_13](https://avatars.discourse-cdn.com/v4/letter/w/7c8e57/32.png) [@Wasim\_Hassan\_13](https://community.f5.com/u/Wasim_Hassan_13)\
**Post date:** [June 17, 2014, 12:01pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/1 "2014-06-17T12:01:06Z")

</div>

Hi,

I have reqirement to redirect multiple wesbites hosted on multiple web servers for Internal users and external Internet users.

Internally i am able to achieve this with mulitple VIP but externally it is not working.

All request will come on HTTPS and it will redirect to different URL with irule.

[https://abc.com](https://abc.com) (VIP 192.168.210.218) redirct to [http://abc.com/url1](http://abc.com/url1)

[https://xyz.com](https://xyz.com) (VIP 192.168.210.217) redirct to [.xyz Domain Names | Join Generation XYZ](http://xyz.com/url2)

[https://123.com](https://123.com) (VIP 192.168.210.219) redirct to [http://123.com:8080/url3](http://123.com:8080/url3)

Now I want that for external usrs these websites should available but i want to use only one Public IP address.

How Can i redirect Internet users request hitting on F5 Public IP address to be redirected to Internal Websites which are hosting on different VIP.

Or is there best way to achieve this. i dont want to use seperate Public IP address for each VIP for external users.

---

<div class="post-metadata">

**Author:** ![nathe](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@nathe](https://community.f5.com/u/nathe)\
**Post date:** [June 17, 2014, 12:20pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/2 "2014-06-17T12:20:55Z")

</div>

Wasim,

Initial thoughts. One IP would need a wildcard or SAN certificate, or even SNI if the clients support this and you’ve got a later version of TMOS (v11.1 or later I think?). This is to prevent certificate issues.

You’d need a clientSSL profile to decrypt the SSL connection and then an iRule / Http class profile or local traffic policy (if TMOS 11.4 or above) to do your redirection based on host header.

```tcl
How Can i redirect Internet users request hitting on F5 Public IP address to be redirected to Internal Websites which are hosting on different VIP.

```

Do you meant to redirect to a new URI, as your example shows above? Or do you mean redirect to another, seperate VIP? If a VIP then this would need to be publicly routable.

Hope this helps, N

---

<div class="post-metadata">

**Author:** ![Wasim\_Hassan\_13](https://avatars.discourse-cdn.com/v4/letter/w/7c8e57/32.png) [@Wasim\_Hassan\_13](https://community.f5.com/u/Wasim_Hassan_13)\
**Post date:** [June 17, 2014, 12:45pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/3 "2014-06-17T12:45:28Z")

</div>

Yes I have public Routable IP address for my F5. I have created the Public DNS records as well to mapped with

[https://abc.mycompany.com](https://abc.mycompany.com) [https://123.mycompany.com](https://123.mycompany.com) [https://xyz.mycompany.com](https://xyz.mycompany.com)

in my public DNS sever.

NOw I want when Internet user type [https://abc.mycompany.com](https://abc.mycompany.com)

above url it should go to the Internal website

[http://abc.com/url1](http://abc.com/url1)

if somoeone type

[https://xyz.mycompany.com](https://xyz.mycompany.com)

it should go to internal website

> **[.xyz Domain Names | Join Generation XYZ](https://gen.xyz/)**
>
> .xyz is for every website, everywhere.® We offer the most flexible and affordable domain names to create choice for the next generation of internet users.

and if someone type on the Internet

[https://xyz.mycompany.com](https://xyz.mycompany.com)

it should go to [http://123.com:8080/url3](http://123.com:8080/url3)

But I want to use only Public Routable IP address of my F5 for which I have created the DNS record in my Public DNS.

Certificate i have already got with the wild card and installed and for internal users it is working fine.

---

<div class="post-metadata">

**Author:** ![Mohamed\_Lrhazi\_1](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@Mohamed\_Lrhazi\_1](https://community.f5.com/u/Mohamed_Lrhazi_1)\
**Post date:** [June 17, 2014, 1:59pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/4 "2014-06-17T13:59:59Z")

</div>

I think it’s not very clear what your problem is… Did you try something and it does not work? Also, what do you mean by “go”, in the for example: " it should go to the Internal website [http://abc.com/url1](http://abc.com/url1) " You are going to send an http redirect, or you plan on rewriting the request? or just routing to specific pool?

---

<div class="post-metadata">

**Author:** ![Matt\_Dierick](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/matt_dierick/32/17074_2.png) [@Matt\_Dierick](https://community.f5.com/u/Matt_Dierick)\
**Post date:** [June 17, 2014, 3:09pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/5 "2014-06-17T15:09:17Z")

</div>

Hi Wasim,

This is supported on BIGIP. As Nathan said, be careful regarding SSL certificate presented to the client.

Anyway, for a technical standpoint, LTM is a reverse proxy. So, in your case, you need to create 1 Virtual Server (you public DNS will redirect users to this VS). You need to create 1 pool per internal application if each application has a different IP address (1 pool for abc, 1 pool for xyz …).

When it’s done, you need to create an iRule which selects the right Pool depending the hostname [HTTP::host]. You can also change the uri if needed [HTTP::uri]

In your case, if I understand well :

- User connects to BIGIP to [https://abc.mydomain.com](https://abc.mydomain.com) (public domain and ip address)
- With the iRule, the bigip opens a connection to the internal server --\> Pool 1 [https://192.168.1.100](https://192.168.1.100)
- With the iRule, BIGIP change URI / to /url3.

So, the user is still connected to [https://abc.mydomain.com](https://abc.mydomain.com) but internally, connection is opened with [http://192.168.1.100/url3](http://192.168.1.100/url3).

Make sense ?

---

<div class="post-metadata">

**Author:** ![Wasim\_Hassan\_13](https://avatars.discourse-cdn.com/v4/letter/w/7c8e57/32.png) [@Wasim\_Hassan\_13](https://community.f5.com/u/Wasim_Hassan_13)\
**Post date:** [June 17, 2014, 6:43pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/6 "2014-06-17T18:43:11Z")

</div>

Hi,

I am able to do this but for this solution i have to use seperate Public IP address for each VIP which I have created for each Website.

I dont have enough Public IP address to advertise all the sites. I want to avoid too many Public IP address.

How I can achieve this. Internal users are working fine, redirection is working fine internally.

Objective: Want to publish all websites again single Public IP address.

---

<div class="post-metadata">

**Author:** ![Wasim\_Hassan\_13](https://avatars.discourse-cdn.com/v4/letter/w/7c8e57/32.png) [@Wasim\_Hassan\_13](https://community.f5.com/u/Wasim_Hassan_13)\
**Post date:** [June 17, 2014, 6:45pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/7 "2014-06-17T18:45:16Z")

</div>

I have configured three URL against three different VIP and these are working fine. Now I want to advertise these websites over the Internet for external users as well. I want to use only one Public IP address and want to achieve load balancing..

---

<div class="post-metadata">

**Author:** ![nathe](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@nathe](https://community.f5.com/u/nathe)\
**Post date:** [June 17, 2014, 8:29pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/8 "2014-06-17T20:29:44Z")

</div>

So my config would be:

1 virtual, public address, wildcard cert, clientssl profile. 3 pools ( I presume internal VIPs point to different pools?). Finally an irule to check http host header and change uri as required. Check out http::ur command on DC.

N

---

<div class="post-metadata">

**Author:** ![Matt\_Dierick](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/matt_dierick/32/17074_2.png) [@Matt\_Dierick](https://community.f5.com/u/Matt_Dierick)\
**Post date:** [June 17, 2014, 8:58pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/9 "2014-06-17T20:58:57Z")

</div>

I understand your public IP address issue. This the reason why irule is needed. Keep in mind there is no redirection when you are on internet. We are talking about rewriting. Users will still use the same public ip address. The bigip will change the URL if needed.

Follow our advices regarding the configuration.

Search pool selection in Devcentral. You will understand.

---

<div class="post-metadata">

**Author:** ![Wasim\_Hassan\_13](https://avatars.discourse-cdn.com/v4/letter/w/7c8e57/32.png) [@Wasim\_Hassan\_13](https://community.f5.com/u/Wasim_Hassan_13)\
**Post date:** [June 19, 2014, 11:25am UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/10 "2014-06-19T11:25:49Z")

</div>

i have created one VIP (192.168.210.157) and NAT to Public IP address and mapped one Pool with two servers in it.

server 1 is hosting below websites

[http://laserfiche/Laserfiche8](http://laserfiche/Laserfiche8) and

[http://carehelpdesk:8080](http://carehelpdesk:8080)

Server 2 is having

[http://erp2.abc.com:7001](http://erp2.abc.com:7001)

I have created the below mention irule so that whenever someone request for server 1 URL F5 should redirect to Server1

when HTTP\_REQUEST {

set host [string tolower [HTTP::host]]

if { $host eq “[https://lf.abc.com](https://lf.abc.com)”} { HTTP::redirect “[http://laserfiche/Laserfiche8](http://laserfiche/Laserfiche8)”

} elseif { $host eq “[https://care.abc.com](https://care.abc.com)”} { HTTP::redirect “[http://carehelpdesk:8080](http://carehelpdesk:8080)”

} elseif { $host eq “[https://erp.abc.com](https://erp.abc.com)”} { HTTP::redirect “[http://erp2.abc.com:7001](http://erp2.abc.com:7001)”

} elseif { $host eq “[https://humanfuel.abc.com](https://humanfuel.abc.com)”} { HTTP::redirect “[https://www.abc/donate/test](https://www.abc/donate/test)” } else { discard

But i am unable to do this. I m getting hitts on irule but websites are not opening.

need assistance in irule.

Object:

Single VIP should serve all the website. irule (either match header/regex etc and send traffic to the desire server.

---

<div class="post-metadata">

**Author:** ![Matt\_Dierick](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/matt_dierick/32/17074_2.png) [@Matt\_Dierick](https://community.f5.com/u/Matt_Dierick)\
**Post date:** [June 19, 2014, 9:07pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/11 "2014-06-19T21:07:29Z")

</div>

Wasim, Can you be more accurate regarding the terms used.

Server 1 is a internal server ? Or a Virtual Server ? I suppose server 1 and 2 are internal server.

I really need a real example with the real fqdn. Because [http://laserfiche/Laserfiche8](http://laserfiche/Laserfiche8) is not a public URL. So you can’t redirect an internet user to this url.

Redirect is a 302 HTTP code. So the user will be redirected to this URL. And unfortunately, this URL is not routed on internet.

What you are requesting is not redirect but pool selection. Actually, you want to select the right server depending the hostname.

You need to create 3 pools :

- Pool\_1 : IP address server 1 + port 80
- Pool\_2 : IP address server 1 + port 8080
- Pool\_3 : IP address server 2 + 7001

Create an iRule like that (just an example)

```tcl
when HTTP_REQUEST {
if { [HTTP::host] eq "https://care.abc.com" } {
  pool Pool_2
  }
  }

```

In this case, when the user will connect to [https://care.abc.com](https://care.abc.com), the BIGIP will open a connection to the server 2 with port 8080.

You need to adapt this irule for your use case with the URI change as well. Keep in mind that the user is on internet and the hostname will never change on his side. Your irule will select the right server and change the port and the URI if needed.

---

<div class="post-metadata">

**Author:** ![Dheer\_282482](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@Dheer\_282482](https://community.f5.com/u/Dheer_282482)\
**Post date:** [August 2, 2016, 11:27pm UTC](https://community.f5.com/t/multiple-website-on-one-vip/3853/12 "2016-08-02T23:27:39Z")

</div>

Hello mates, I need help on below scenario working on SSL (no offloading)

/ / example :- if url “[https://hello.abc.com](https://hello.abc.com)” traffic will be go to Pool :- [hello.abc.com](http://hello.abc.com)

```tcl
if url "https://hi.abc.com" traffic will go to Pool :- hi.abc.com 

      where VIP is same with port for https://hello.abc.com & https://hi.abc.com

```
