Forum Discussion

Fernando_Clemen's avatar
Fernando_Clemen
Icon for Nimbostratus rankNimbostratus
Jun 12, 2019
Solved

iRule redirect connection to pool on differente port

Hi!

 

Is it possible to redirect the connection based on the URI?

 

Example:

 

http://mydomain1.com

Send to mypool on port 5000

 

http://mydomain2.com

Send to mypool on port 6000

 

However I would like it to always be for the same pool but on different ports.

  • Create two pools, e.g. mydomain1.com_5000 and mydomain2.com_6000, then create a Traffic Policy with a rule for each hostname forwarding to the associated pool.

     

    E.g.

3 Replies

  • Create two pools, e.g. mydomain1.com_5000 and mydomain2.com_6000, then create a Traffic Policy with a rule for each hostname forwarding to the associated pool.

     

    E.g.

    • Fernando_Clemen's avatar
      Fernando_Clemen
      Icon for Nimbostratus rankNimbostratus

      This pool will be used by Service Fabric and each container will run on a different port, I was trying to use the same pool, it is possible that we have about one hundred containers.

       

      Thank you!

      • Andy_McGrath's avatar
        Andy_McGrath
        Icon for Cumulonimbus rankCumulonimbus

        I would recommend scripting the configuration or even look at somethink like Ansible to deploy everything.

         

        I might be tempted to look at an iRule to do this but the issue you have is the iRule event will be triggered before the Pool Member has been selected.

         

        To fix this could set a varible in the request and then change the node and port after LB_SELECTED event.

         

        You could still do this with multiple pools and an iRules (and may be a Data Group if you need static hostname to pool mapping) which might be easier that a large Traffic Policy.

         

        If I have time today will have a think about how this might work.