# iRule Pool URI single node

**URL:** <https://community.f5.com/t/irule-pool-uri-single-node/15243>\
**Category:** Technical Forums\
**Tags:** performance, big-ip-access-policy-manager-apm, security, ltm, application-delivery\
**Created:** [June 12, 2015, 8:52am UTC](https://community.f5.com/t/irule-pool-uri-single-node/15243 "2015-06-12T08:52:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MDPF52\_180608](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@MDPF52\_180608](https://community.f5.com/u/MDPF52_180608)\
**Post date:** [June 12, 2015, 8:52am UTC](https://community.f5.com/t/irule-pool-uri-single-node/15243/1 "2015-06-12T08:52:19Z")

</div>

Hello DevCentral,

I want to ask you if is possible to do the following with an iRule:

I virtual server that have a pool with a single node ( 10.x.x.x ). Virtual server listens on port 443, Node listens on port 8443 but have different apps identified by : & how i can manage the request on the VS in order to have the following flow:

--\> node1/app1 --\> node2/app2

There is something like : pool/app1 , pool/app2 ?

Thanks in advance

Best regards,

M.

---

<div class="post-metadata">

**Author:** ![Samir\_Jha\_52506](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@Samir\_Jha\_52506](https://community.f5.com/u/Samir_Jha_52506)\
**Post date:** [June 12, 2015, 9:05am UTC](https://community.f5.com/t/irule-pool-uri-single-node/15243/2 "2015-06-12T09:05:54Z")

</div>

I never tired but its bit difficult to send traffic to same port & Node with 2 different apps. If you will have two ports(services) with same node then iRule can help.

---

<div class="post-metadata">

**Author:** ![Stefan\_Klotz](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/stefan_klotz/32/19800_2.png) [@Stefan\_Klotz](https://community.f5.com/u/Stefan_Klotz)\
**Post date:** [June 12, 2015, 9:08am UTC](https://community.f5.com/t/irule-pool-uri-single-node/15243/3 "2015-06-12T09:08:46Z")

</div>

You mentioned that you have just ONE node in the pool, but in your example you are referring to TWO:

```tcl
https://virtualserver/app1 --> node1/app1
https://virtualserver/app2 --> node2/app2

```

Assuming you have really just ONE node in the pool, there is nothing you must adjust with an iRule, because the incoming URI (/app1 or /app2) will be used towards the node/server as well.

But if you really have different nodes/servers for different URIs you can create a dedicated pool for each URI and handle the pool assignment via iRule (no default pool configured on the VS). Depending on the amount of different URIs you can either work with the switch-statement or just with simple if-statements.

```tcl
when HTTP_REQUEST {
    if { [HTTP::uri] starts_with "/app1" } {
        pool 
    } elseif { [HTTP::uri] starts_with "/app2" } {
        pool 
    } ....
}

when HTTP_REQUEST {
    switch -glob [string tolower [HTTP::uri]] {
        "/app1*" {
            pool 
        }
        "/app2*" {
            pool 
        }
        ...
    }
}

```

As you mentioned that your VS is running on port 443, I assume you have the certificate installed on the BIG-IP.

Ciao Stefan 🙂

---

<div class="post-metadata">

**Author:** ![MDPF52\_180608](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@MDPF52\_180608](https://community.f5.com/u/MDPF52_180608)\
**Post date:** [June 12, 2015, 9:33am UTC](https://community.f5.com/t/irule-pool-uri-single-node/15243/4 "2015-06-12T09:33:21Z")

</div>

No, sorry was a typo. This is correct : --\> node1/app1 --\> node1/app2

---

<div class="post-metadata">

**Author:** ![Stefan\_Klotz](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/stefan_klotz/32/19800_2.png) [@Stefan\_Klotz](https://community.f5.com/u/Stefan_Klotz)\
**Post date:** [June 12, 2015, 10:35am UTC](https://community.f5.com/t/irule-pool-uri-single-node/15243/5 "2015-06-12T10:35:44Z")

</div>

You don’t need to direct differently, because there is only ONE node available.

Everything will be handled on webserver level, means if the incoming URI starts with /app1 server will respond with content of app1 and if it’s /app2 server will respond with content of app2.

So if the app-separating URI will already used to access the VS, nothing special needs to be configured on the BIG-IP.

Ciao Stefan 🙂
