Forum Discussion

Aj15's avatar
Icon for Altostratus rankAltostratus
Mar 26, 2021

Need help to write irule

got confused with irule I am currently right a irule but not getting an expected output. used the concept from irule of f5 201 courses when the client makes a request on
  • Nikoolayy1's avatar
    Mar 27, 2021

    I don't think it is possible for your url to remain the same after you use HTTP redirect as it is the idea HTTP redirect. Use a pool command for this and add all the nodes that are with FQDN in that pool. See :



    If you want the hosts to change from to then but the URI to remain the same /CredentialApiService /CerdentialManager or then use HTTP redirect your irule should look like HTTP::redirect "" or HTTP::redirect ""



    Also I see for equals "CerdentialManager" it should be equals "/CerdentialManager" as you missed to add "/" at the start. You may also add a default pool under the VIP if you have not added one if nothing matches this pool willl andle it.


    Also HTTP redirect or selecting a pool based on hostname, URI or pool can be done nowadays with local traffic policy, so better use tem as they are better optimized than the iRules:








    Edit(I forgot to add):


    You may also test the command irule ''virtual'' for internally redirecting traffic from one vip to another vip on the same F5 device but it does not work in some cases. Search devcentral discussions about the irule ''virtual'' command:




    Example discussion: