Forum Discussion
Need help to write irule
- 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 cm.login.abc.com in that pool. See : https://clouddocs.f5.com/api/irules/pool.html
If you want the hosts to change from cm.login.abc.com to xyzs.anc.vtc.com then but the URI to remain the same /CredentialApiService /CerdentialManager or then use HTTP redirect your irule should look like HTTP::redirect "https://cm.login.abc.com/CredentialApiService" or HTTP::redirect "https://cm.login.abc.com/CerdentialManager"
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:
https://support.f5.com/csp/article/K26312346
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:
https://clouddocs.f5.com/api/irules/virtual.html
Example discussion:
https://devcentral.f5.com/s/question/0D51T00006i7kHX/irule-to-redirect-to-another-vs-on-the-same-ltm
@NiKoolayy1
Yeah, the Concept of a Virtual Server Worked for me.
Thanks :)
- Nikoolayy1Mar 30, 2021MVP
Can you mark the question as closed, so we can close this discussion.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com