Technical Forum
Ask questions. Discover Answers.
Showing results for 
Search instead for 
Did you mean: 



Hi Team 

I want to ask how can do load balancing for both servers in the following path:

I don't know how can put the path in the pool to attach it in Virtual server and also how add


Don't think you would look at the URI when configring VS. You would create a New Virtual server with the pool members 192:168.10.1 and port 8080. You can use the "path" to create a https monitor and apply it on the pool. Don't know if that answered your question. 


@ahmed-ys What I understand is that you have two pool members one with and another pool member on in a pool which is associated to a virtual server. Typically you send an HTTP request to a virtual server which might come in as "" or "" which automatically will load balance out to both pool members on their respective IP. Now if you only want "/path2" to go to the .2 server and "/path1" to go to the .1 server I would configure two seperate pools, one with the .1 in it and another with the .2 in it and then point to those pools with an iRule dependent on the path. Keep in mind that you do have to perform SSL termination on the F5 to do this. If I missunderstood your configuration or your question please provide some additional detail and we might be able to assist further.

Hi Paulius 

actually, I need to do a load balance with /Path1  for both servers

so I can go with VS for example and the backend will be both servers, so how can achieve the load balance with /path1/ .. this is my equation because I did a LTM with only ports not include path


@ahmed-ys If you configure your virtual server (VS) to listen on and your pool members to be and and a request comes in for this should be balanced to either pool member without any additional configuration as long as your pool members are both passing the health monitor or if no health monitor is associated to the pool or pool members it will send traffic to the next available pool member. If this is not working you might consider running the following tcpdump to see if you can figure out why it isn't working. This particular tcpdump will capture all traffic coming from you client IP and destined to port 8080 which will include the VS IP, pool member IPs, and if you have SNAT configured it will show where the traffic is sent after the SNAT is applied.

tcpdump -nni 0.0:nnp host <your_client_ip> and port 8080



The url path does not problem at load balancing.
but if you want add the another path to each server, you resolve the add or rewrite method in iRule.

Thanks Hooni, my problem with load balancing for URL Path

Hi, @ahmed-ys 

Do you mean that only requests coming to /path1/* should be load-balanced, and any other requests should be denied?

If so, you need an iRule (or a policy) that would enforce it.

You also need an HTTP profile in your virtual server, and if the traffic is encrypted, you need Client and Server SSL profiles.


Thanks, Mike maybe my question is not clear, the question is the following, is the path of the server should be put into consideration when we will configure the virtual server? if the path is the same in two backend server

Hi, @ahmed-ys

In F5, you have the option of considering the HTTP path to perform load balancing decisions - for instance, URIs matching /path1/* are load-balanced to one pool, URIs matching /path2/* are load-balanced to a different pool. Just google it, and you'll find multiple examples of how to do that using iRules. 

But if you need to do it in this scenario, I cannot say. It depends on the needs of the application itself. The best person to answer that question is the application owner/developer. Did they give you any specific instructions regarding HTTP path?



Hi Guys

I tested it and it's working If the path is the same for both backend servers so no extra configuration is needed, just put the VS with the port number in the configuration.

This was my question and now it's working

Thanks All for the help