# reverse proxy

**URL:** <https://community.f5.com/t/reverse-proxy/38724>\
**Category:** Technical Forums\
**Tags:** big-ip, devops, ltm, application-delivery\
**Created:** [January 2, 2018, 8:45pm UTC](https://community.f5.com/t/reverse-proxy/38724 "2018-01-02T20:45:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mc\_344761](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mc\_344761](https://community.f5.com/u/mc_344761)\
**Post date:** [January 2, 2018, 8:45pm UTC](https://community.f5.com/t/reverse-proxy/38724/1 "2018-01-02T20:45:48Z")

</div>

Hi All,

We are going to use BIG-IP mainly as a reverse proxy.

A test scenario (see attached drawing) is that a user on Internet (client side) will access 2 web services running on 2 internal servers (server-001 and server-002). Depending on URL the user is executing it should be served different web services:

[https://test.com/](https://test.com/) - web service

[https://test.com/sales](https://test.com/sales) - web service

I hope some of you could give some tips for what is the right way to implement it. I wondered if that would work:

- create virtual server with our company SSL Profile on client side and default ‘serverssl’ on server side
- that virtual server is assigned a pool of 2 nodes: server-001 and server-002
- that virtual server is assigned ‘rewrite profile’ for URI translation as followed:

[https://test.com/](https://test.com/) →

[https://test.com/sales](https://test.com/sales) →

Is it a proper way of setting up the reverse proxy for our need? Or maybe am I approaching it totally wrong? Are iRules or other features of BIG-IP a better option here?

Any hint will be much appreciated. Thanks!

 ![image_182135.jpg](https://d20hrnpixdzcsd.cloudfront.net/original/2X/0/0c27e86f7e52fce0028d0cf692c1465c72b07305.jpeg)

---

<div class="post-metadata">

**Author:** ![Srini\_87152](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Srini\_87152](https://community.f5.com/u/Srini_87152)\
**Post date:** [January 3, 2018, 6:41am UTC](https://community.f5.com/t/reverse-proxy/38724/2 "2018-01-03T06:41:25Z")

</div>

Hi,

You can do via irule but what is the case if node1 down? Will node2 serve the request? Or you want alwys goes node1 and fail request if node2 not available?

Thx Srini

---

<div class="post-metadata">

**Author:** ![mc\_344761](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mc\_344761](https://community.f5.com/u/mc_344761)\
**Post date:** [January 3, 2018, 7:04am UTC](https://community.f5.com/t/reverse-proxy/38724/3 "2018-01-03T07:04:17Z")

</div>

Hi Srini,

node 1 (server-001) is for request 1 ([https://test.com/](https://test.com/)) and node-2 (server-002) is for request 2 ([https://test.com/sale](https://test.com/sale)).

node 1 and node 2 are not redundant to each other meaning if node 2 is down then the request 2 won’t work and vice versa. Is it ok to have them in the same pool then - im just thinking loudly…

rewrite profile won’t work here?

Thanks

---

<div class="post-metadata">

**Author:** ![Srini\_87152](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Srini\_87152](https://community.f5.com/u/Srini_87152)\
**Post date:** [January 3, 2018, 3:17pm UTC](https://community.f5.com/t/reverse-proxy/38724/4 "2018-01-03T15:17:26Z")

</div>

hi,

you can create two pools, pool\_pool1 with node1 server and pool\_pool2 with node 2 server. Assign default pool with pool\_pool1 at vip level and create following irule assign to vip

So any traffic coming on [https://test.com/](https://test.com/) it connect to pool\_pool1 and /slae will connect to pool\_pool2

Thx

Srini

=========================================================

when HTTP\_REQUEST { switch -glob [string tolower [HTTP::path]] { “/sale” { pool pool\_pool2 } default { drop } } }

=========================================

---

<div class="post-metadata">

**Author:** ![mc\_344761](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mc\_344761](https://community.f5.com/u/mc_344761)\
**Post date:** [January 3, 2018, 10:59pm UTC](https://community.f5.com/t/reverse-proxy/38724/5 "2018-01-03T22:59:09Z")

</div>

Thanks again Srini,

As you pointed, I have now created 2 pools (one pool for each server).

Tried both suggested by you iRule (I must refresh my coding knowledge :)) and other solution based on policy and rewrite profile (see furhter down). None of them worked out yet but im still testing.

And still some issues:

- request from internet to VS comes as [https://test.com](https://test.com)
  - Client SSL profile was created and linked to VS on Client side

- request from VS to server must have a format of **test.exe** (including test.exe part)
  - so I believe my iRule will have to include that change in URL (in addition to redirecting traffic to a proper pool) - or is there other way of fixing it? should I mix with rewrite profile or better include everything in the iRule?

- in addition https between VS and server is using another SSL profile (other certificate)
  - when I tested it towards only one pool I managed to access a webpage but it was presented as a simple text - looks like there are some issues With java scripts… Wonder if it could have anything to do with the fact of using different SSL profiles on client and server side

I found this article about setting up BIG-IP as a reverse proxy with use of policy and rewrite profile:

> **[404 Page not found | BIG-IP Documentation](https://techdocs.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-implementations-11-4-0/21.html)**
>
> Usage information and technical documentation for BIG-IP and other related F5 products

Using rewrite profile takes care of URL change and a policy of redirecting traffic to a proper pool. I tested it but policy didn’t work for me - all requests are forwardedd to the same pool 😕

Anyway - appreciate your help. Do you know if using 2 SSL profiles (with different certificates) for internal and external side of BIG-IP might be a problem in my case?

Thanks again

mc

---

<div class="post-metadata">

**Author:** ![Srini\_87152](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Srini\_87152](https://community.f5.com/u/Srini_87152)\
**Post date:** [January 3, 2018, 11:47pm UTC](https://community.f5.com/t/reverse-proxy/38724/6 "2018-01-03T23:47:02Z")

</div>

My bad,i was missed test.exe .. 2 SSL profile [bridging] should fine.

Thx

Srini

---

<div class="post-metadata">

**Author:** ![mc\_344761](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mc\_344761](https://community.f5.com/u/mc_344761)\
**Post date:** [January 16, 2018, 9:53am UTC](https://community.f5.com/t/reverse-proxy/38724/7 "2018-01-16T09:53:57Z")

</div>

Thanks for your help and sorry late response. At the end I set 1 VS without any pool defined in resources. REWRITE profile linked to that VS rewrites URL links accordingly. POLICY redirects https requests to the right pools based in requesting URI.

michal

---

<div class="post-metadata">

**Author:** ![Amresh008](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Amresh008](https://community.f5.com/u/Amresh008)\
**Post date:** [January 16, 2018, 10:25am UTC](https://community.f5.com/t/reverse-proxy/38724/8 "2018-01-16T10:25:58Z")

</div>

Hi Michal,

I would suggest you to start the config without the SSL, as when non-ssl set up works, the ssl soon would. You should first be able to get the incoming traffic hit your servers. As you are dealing with different interfaces (WAN side and LAN side) with diff range of IP addresses, it would require routing or Natting for the traffic to pass your load balancer and you would also require config for reverse route.rest of the config is easy 🙂
